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

运行时出错。是不是hibernate.cfg.xml文件出错了啊?求指点

编译的结果:

一月 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>


正在回答

2 回答

oracle11g,jar包是ojdbc6.jar,在目录文件中找到的,版本是匹配的,我另外单独创建了一个java工程,使用jdbc创建表格,增删改查功能都可以导入,所以我又怀疑是hibernatejar的问题。hibernate.cfg.xml这个文件没错吧?

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

首先你是的Oracle数据库的版本是多少,然后导入的Oracle驱动jar包版本是多少,可能是版本不匹配!

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

举报

0/150
提交
取消

运行时出错。是不是hibernate.cfg.xml文件出错了啊?求指点

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