为了账号安全,请及时绑定邮箱和手机立即绑定

这是为什么

2016-5-15 22:33:11 org.hibernate.Version logVersion

INFO: HHH000412: Hibernate Core {5.1.0.Final}

2016-5-15 22:33:11 org.hibernate.cfg.Environment <clinit>

INFO: HHH000206: hibernate.properties not found

2016-5-15 22:33:11 org.hibernate.cfg.Environment buildBytecodeProvider

INFO: HHH000021: Bytecode provider name : javassist

2016-5-15 22:33:11 org.hibernate.boot.jaxb.internal.stax.LocalXmlResourceResolver resolveEntity

WARN: HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-configuration. Use namespace http://www.hibernate.org/dtd/hibernate-configuration instead.  Support for obsolete DTD/XSD namespaces may be removed at any time.

2016-5-15 22:33:11 org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>

INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}

2016-5-15 22:33:11 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)

2016-5-15 22:33:12 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator

INFO: HHH10001005: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/imooc?useUnicode=true&characterEncoding=utf8]

2016-5-15 22:33:12 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator

INFO: HHH10001001: Connection properties: {user=root, password=****}

2016-5-15 22:33:12 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator

INFO: HHH10001003: Autocommit mode: false

2016-5-15 22:33:12 org.hibernate.engine.jdbc.connections.internal.PooledConnections <init>

INFO: HHH000115: Hibernate connection pool size: 20 (min=1)

Sun May 15 22:33:12 CST 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

2016-5-15 22:33:12 org.hibernate.dialect.Dialect <init>

INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect

Exception in thread "main" java.lang.NullPointerException

at com.imooc.entity.Test.add(Test.java:21)

at com.imooc.entity.Test.main(Test.java:10)


正在回答

3 回答

Sun May 07 14:05:09 CST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

0 回复 有任何疑惑可以回复我~

 现在的连接url:Connection connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/test?useSSL=false","root", "letmein");     不使用ssl协议即可 安全套接层

2 回复 有任何疑惑可以回复我~

我是hibernate5,不同版本存在细微差异,看一下说明文档。ServiceRegistry serviceRegistry=new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).configure().build();

在老师用的4.2好像是ServiceRegistry serviceRegistry=new ServiceRegistryBuilder().applySettings(configuration.getProperties()).build();

没有代码我也分析不了

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Hibernate初探之一对多映射
  • 参与学习       42171    人
  • 解答问题       295    个

Hibernate中一对多关联映射配置,以及cascade和inverse属性作用

进入课程

这是为什么

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信