Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp hibernate_test_start.................. 七月 21, 2016 1:06:06 下午 org.hibernate.Version logVersion INFO: HHH000412: Hibernate Core {5.2.1.Final} 七月 21, 2016 1:06:06 下午 org.hibernate.cfg.Environment <clinit> INFO: HHH000206: hibernate.properties not found 七月 21, 2016 1:06:06 下午 org.hibernate.cfg.Environment buildBytecodeProvider INFO: HHH000021: Bytecode provider name : javassist 七月 21, 2016 1:06:07 下午 org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit> INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final} 七月 21, 2016 1:06:07 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!) 七月 21, 2016 1:06:07 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH10001005: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/hbntest] 七月 21, 2016 1:06:07 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH10001001: Connection properties: {user=root, password=****} 七月 21, 2016 1:06:07 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH10001003: Autocommit mode: false 七月 21, 2016 1:06:07 下午 org.hibernate.engine.jdbc.connections.internal.PooledConnections <init> INFO: HHH000115: Hibernate connection pool size: 20 (min=1) 七月 21, 2016 1:06:07 下午 org.hibernate.dialect.Dialect <init> INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect 七月 21, 2016 1:06:08 下午 org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl useContextualLobCreation INFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4????这是什么错???
我用eclipse生成hibernate逆向工程,用单元测试一下报错了
User:
package com.bean; // Generated 2016-7-21 13:03:09 by Hibernate Tools 5.1.0.Beta1 /** * User generated by hbm2java */ public class User implements java.io.Serializable { private int uid; private String uname; private String upass; public User() { } public User(int uid) { this.uid = uid; } public User(int uid, String uname, String upass) { this.uid = uid; this.uname = uname; this.upass = upass; } public int getUid() { return this.uid; } public void setUid(int uid) { this.uid = uid; } public String getUname() { return this.uname; } public void setUname(String uname) { this.uname = uname; } public String getUpass() { return this.upass; } public void setUpass(String upass) { this.upass = upass; } }
User.hbm.xml:
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> <!-- Generated 2016-7-21 13:03:09 by Hibernate Tools 5.1.0.Beta1 --> <hibernate-mapping> <class name="com.bean.User" table="user" catalog="hbntest" optimistic-lock="version"> <id name="uid" type="int"> <column name="uid" /> <generator class="native" /> </id> <property name="uname" type="string"> <column name="uname" length="45" /> </property> <property name="upass" type="string"> <column name="upass" length="45" /> </property> </class> </hibernate-mapping>
package com.test; import org.hibernate.Session; import org.hibernate.Transaction; import org.junit.Test; import com.bean.User; public class HibernateTest { @Test public void test() { System.out.println("hibernate_test_start.................."); Session s=HibernateUtil.getSessionFactory().openSession(); Transaction tx=s.beginTransaction(); User u=new User(2,"zyw","123456"); s.save(u); tx.commit(); s.close(); } }