着你追
2015-12-26 22:51
Hibernate:
select
users0_.uid as uid1_1_,
users0_.username as username2_1_,
users0_.password as password3_1_
from
USERS users0_
where
users0_.username=?
and users0_.password=?
这个没报错 程序是没问题的 关键是你预期应该有什么反应 有几种情况 1、数据没查出匹配的值,没查出值是为什么呢,可能是就是没有符合条件的数据,或者查询条件的哪个值没注入进来 2、你要的那个反应的代码写了么,比如,登陆之后你要跳转,那跳转的那个代码对么
表单传参有问题password,传出的值为null
再补充详细一点
---------------------------------
十二月 26, 2015 10:55:38 下午 org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}
十二月 26, 2015 10:55:38 下午 org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.2.4.Final}
十二月 26, 2015 10:55:38 下午 org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
十二月 26, 2015 10:55:38 下午 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
十二月 26, 2015 10:55:38 下午 org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
十二月 26, 2015 10:55:38 下午 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
十二月 26, 2015 10:55:39 下午 org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
十二月 26, 2015 10:55:39 下午 org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: entity/Students.hbm.xml
十二月 26, 2015 10:55:39 下午 org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
十二月 26, 2015 10:55:39 下午 org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: entity/Users.hbm.xml
十二月 26, 2015 10:55:39 下午 org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
十二月 26, 2015 10:55:39 下午 org.hibernate.cfg.Configuration doConfigure
INFO: HHH000041: Configured SessionFactory: null
十二月 26, 2015 10:55:39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)
十二月 26, 2015 10:55:39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000115: Hibernate connection pool size: 20
十二月 26, 2015 10:55:39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000006: Autocommit mode: false
十二月 26, 2015 10:55:39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql:///sgdata?userUnicode=true&characterEncoding=UTF-8]
十二月 26, 2015 10:55:39 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000046: Connection properties: {user=root, password=****}
十二月 26, 2015 10:55:39 下午 org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
十二月 26, 2015 10:55:39 下午 org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation
INFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
十二月 26, 2015 10:55:39 下午 org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
十二月 26, 2015 10:55:39 下午 org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory
十二月 26, 2015 10:55:40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000228: Running hbm2ddl schema update
十二月 26, 2015 10:55:40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000102: Fetching database metadata
十二月 26, 2015 10:55:40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000396: Updating schema
十二月 26, 2015 10:55:40 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: sgdata.students
十二月 26, 2015 10:55:40 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [birthday, address, gender, sname, sid]
十二月 26, 2015 10:55:40 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: []
十二月 26, 2015 10:55:40 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [primary]
十二月 26, 2015 10:55:40 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000261: Table found: sgdata.users
十二月 26, 2015 10:55:40 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000037: Columns: [uid, password, username]
十二月 26, 2015 10:55:40 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000108: Foreign keys: []
十二月 26, 2015 10:55:40 下午 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [primary]
十二月 26, 2015 10:55:40 下午 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000232: Schema update complete
十二月 26, 2015 10:55:40 下午 org.hibernate.hql.internal.ast.HqlSqlWalker generatePositionalParameter
WARN: [DEPRECATION] Encountered positional parameter near line 1, column 34. Positional parameter are considered deprecated; use named parameters or JPA-style positional parameters instead.
十二月 26, 2015 10:55:40 下午 org.hibernate.hql.internal.ast.HqlSqlWalker generatePositionalParameter
WARN: [DEPRECATION] Encountered positional parameter near line 1, column 49. Positional parameter are considered deprecated; use named parameters or JPA-style positional parameters instead.
Hibernate:
select
users0_.uid as uid1_1_,
users0_.username as username2_1_,
users0_.password as password3_1_
from
USERS users0_
where
users0_.username=?
and users0_.password=?
使用Struts2+Hibernate开发学生信息管理功能
80701 学习 · 754 问题
相似问题
回答 7
回答 1