I am new to Hibernate, but not to
JDBC.
When attempting to run an elaborate Hibernate-enabled app in eclipse, I get the error copied below.
Below, I include copies of the error stack trace, a successful Hello World hibernate configuration, and my unsuccessful hibernate configuration.
--A
test program using the same connection information (triple checked) hits the database successfully.
--The hello world Hibernate application with a simple hibernate.cfg.xml file also hits the database successfully.
--but my larger hibernate application fails to connect to the database.
THANKS IN ADVANCE FOR ANY AND ALL SUGGESTIONS!
The error produced by the large hibernate application is:
java.sql.SQLException: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at ocao.adss.reallocator.OCAODataSource.getConnection(OCAODataSource.java:38)
The successful helloworld hibernate configuration is:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
..CONNECTION INFO (USERNAME, PASSWORD, URL)..
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- Mapping files -->
<mapping resource="contact.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Now, here is my behemouth hibernate config that is yielding the connection timeout error above. (of course I suppose the problem could be in code):
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.query.factory_class">
org.hibernate.hql.ast.ASTQueryTranslatorFactory
</property>
<property name="hibernate.jdbc.batch_size">30</property>
<property name="hibernate.jdbc.use_streams_for_binary">
true
</property>
<!-- <property name="hibernate.default_schema">adss_prod</property> -->
<property name="hibernate.use_outer_join">true</property>
<property name="hibernate.cache.provider_class">
org.hibernate.cache.EhCacheProvider
</property>
<property name="hibernate.dialect">
org.hibernate.dialect.Oracle9Dialect
</property>
<property name="hibernate.connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
...CONNECTION INFO (URL, USERNAME, PASSWORD)
<property name="hibernate.cglib.use_reflection_optimizer">
false
</property>
...MANY HBM MAPPING FILES LIKE THE ONE JUST BELOW
<mapping resource="wrtt/adkt/model/core/College.hbm.xml" />
</session-factory>
</hibernate-configuration>