這是為什么
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)
2017-05-07
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.
2016-12-31
現在的連接url:Connection connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/test?useSSL=false","root", "letmein"); ? ? 不使用ssl協議即可 安全套接層
2016-12-28
我是hibernate5,不同版本存在細微差異,看一下說明文檔。ServiceRegistry serviceRegistry=new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).configure().build();
在老師用的4.2好像是ServiceRegistry serviceRegistry=new ServiceRegistryBuilder().applySettings(configuration.getProperties()).build();
沒有代碼我也分析不了