慕白白zzZ
2017-12-25 15:47
代码没错,可以运行 可是出不来sid
十二月 25, 2017 3:27:19 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)
十二月 25, 2017 3:27:19 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000115: Hibernate connection pool size: 20
十二月 25, 2017 3:27:19 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000006: Autocommit mode: false
十二月 25, 2017 3:27:19 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000401: using driver [com.microsoft.sqlserver.jdbc.SQLServerDriver] at URL [jdbc:sqlserver://localhost:1433;DataBaseName=test]
十二月 25, 2017 3:27:19 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000046: Connection properties: {user=sa, password=****}
十二月 25, 2017 3:27:20 下午 org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.SQLServerDialect
十二月 25, 2017 3:27:20 下午 org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
十二月 25, 2017 3:27:20 下午 org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory
十二月 25, 2017 3:27:20 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000228: Running hbm2ddl schema update
十二月 25, 2017 3:27:20 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000102: Fetching database metadata
十二月 25, 2017 3:27:20 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000396: Updating schema
十二月 25, 2017 3:27:21 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: test.dbo.STUDENTS
十二月 25, 2017 3:27:21 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [birthday, address, gender, sname, sid]
十二月 25, 2017 3:27:21 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: []
十二月 25, 2017 3:27:21 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [pk__students__dddfdd3688808e4b]
十二月 25, 2017 3:27:21 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: test.dbo.USERS
十二月 25, 2017 3:27:21 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [uid, password, username]
十二月 25, 2017 3:27:21 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: []
十二月 25, 2017 3:27:21 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [pk__users__dd701264abf195e1]
十二月 25, 2017 3:27:21 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000232: Schema update complete
Hibernate:
select
max(students0_.sid) as col_0_0_
from
STUDENTS students0_
仔细检查了下,单元测试一直死循环就会这样,原因是下面这个循环里,我不小心写成了i<7-len
for(int j=0;j<7-len;j++) {
temp = "0" + temp;
}
同问啊
检查一下学号的主键生成策略是不是对的
使用Struts2+Hibernate开发学生信息管理功能
80701 学习 · 754 问题
相似问题