使用Hibernate成功连接到Oracle需要3分钟

问题描述 投票:0回答:1

朋友告诉我Hibernate三分钟工作的原因。

在获得工厂的方法:

sessionFactory = new Configuration().configure().buildSessionFactory();

的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="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="hibernate.connection.url">jdbc:oracle:thin:@<IP>:1521:sbboldev</property>
        <property name="hibernate.connection.username">login</property>
        <property name="hibernate.connection.password">password</property>
        <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
        <property name="hibernate.default_schema">login</property>
        <property name="show_sql">true</property>

        <mapping resource="Developer.hbm.xml"/>

    </session-factory>
</hibernate-configuration>

database_module.log

2019-02-08 12:06:08 DEBUG JdbcEnvironmentInitiator:72 - Database ->
       name : Oracle
    version : Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
      major : 11
      minor : 2
2019-02-08 12:06:08 DEBUG JdbcEnvironmentInitiator:83 - Driver ->
       name : Oracle JDBC driver
    version : 11.2.0.4.0
      major : 11
      minor : 2
2019-02-08 12:06:08 DEBUG JdbcEnvironmentInitiator:389 - JDBC version : 11.2
2019-02-08 12:06:08 INFO  Dialect:158 - HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect
2019-02-08 **12:06:08** DEBUG DefaultSchemaNameResolver:53 - Unable to use Java 1.7 Connection#getSchema
2019-02-08 **12:09:15** DEBUG Namespace:51 - Created database namespace [logicalName=Name{catalog=null, schema=null}, physicalName=Name{catalog=null, schema=null}]
2019-02-08 12:09:15 DEBUG ModelBinder:239 - Mapping class: net.proselyte.hibernate.example.Developer -> HIBERNATE_DEVELOPERS

Hibernate核心版本:5.4.1.Final。 Java版本:1.8.0_161。

hibernate connect long-integer
1个回答
0
投票

你能用最新的18.3 JDBC driver吗?

© www.soinside.com 2019 - 2024. All rights reserved.