運(yùn)行時(shí)出錯(cuò)。是不是hibernate.cfg.xml文件出錯(cuò)了???求指點(diǎn)
編譯的結(jié)果:
一月 19, 2017 4:48:06 下午 org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {5.2.6.Final}
一月 19, 2017 4:48:06 下午 org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
一月 19, 2017 4:48:07 下午 org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
一月 19, 2017 4:48:07 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)
一月 19, 2017 4:48:07 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001005: using driver [oracle.jdbc.driver.OracleDriver] at URL [jdbc:oracle:thin:@localhost:1521:hibernate]
一月 19, 2017 4:48:07 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001001: Connection properties: {user=system, password=****}
一月 19, 2017 4:48:07 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001003: Autocommit mode: false
一月 19, 2017 4:48:07 下午 org.hibernate.engine.jdbc.connections.internal.PooledConnections <init>
INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
這是hibernate.cfg.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
? ? <session-factory>
? ? <property name="connection.username">system</property>
? ? <property name="connection.password">huo123456</property>
? ? <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
? ? <property name="connection.url">jdbc:oracle:thin:@localhost:1521:hibernate</property>
? ? <property name="dialect">org.hibernate.dialect.Oracle11Dialect</property>
? ??
? ? <property name="show_sql">true</property>
? ? <property name="format_sql">true</property>
? ? <property name="hbm2ddl.auto">create</property>
? ? <mapping resource="Students.htm.xml"/>
? ? </session-factory>
</hibernate-configuration>
2017-01-21
oracle11g,jar包是ojdbc6.jar,在目錄文件中找到的,版本是匹配的,我另外單獨(dú)創(chuàng)建了一個(gè)java工程,使用jdbc創(chuàng)建表格,增刪改查功能都可以導(dǎo)入,所以我又懷疑是hibernatejar的問(wèn)題。hibernate.cfg.xml這個(gè)文件沒(méi)錯(cuò)吧?
2017-01-20
首先你是的Oracle數(shù)據(jù)庫(kù)的版本是多少,然后導(dǎo)入的Oracle驅(qū)動(dòng)jar包版本是多少,可能是版本不匹配!