wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Hibernate 2.1 and Oracle 9.2.0.4 connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate 2.1 and Oracle 9.2.0.4 connection " Watch "Hibernate 2.1 and Oracle 9.2.0.4 connection " New topic
Author

Hibernate 2.1 and Oracle 9.2.0.4 connection

javaa user
Greenhorn

Joined: Sep 27, 2004
Posts: 1
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<session-factory >

<!-- local connection properties -->
<property name="connection.url">jdbc racle:thin@url:1521:sid</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.username">username</property>
<property name="connection.password">password</property>
<!-- property name="connection.pool_size"></property -->

<!-- dialect for Oracle 9 -->
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>

<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>

<mapping resource="com/test/hibernate/mappings/table.hbm.xml"/>

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

Above is the config file that i am using to connect to oracle 9i
I have the url, user, password and table = values entered correctly
I am using ojdbc14.jar. I am able to connect to DB from outside.

I am receiving the following error while trying to execute a simple HQL on the table (used in mapping above). can anyone help.. thanks..

Could not obtain connection metadata
java.sql.SQLException: Invalid Oracle URL specified
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:188)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:101)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:73)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1155)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:789)
at com.aol.test.HibernateTest.main(HibernateTest.java:23)
Kevin St. Clair
Greenhorn

Joined: Aug 07, 2004
Posts: 2
I think maybe your Oracle jdbc URL is not formed correctly. Your value:
<code>jdbc racle:thin@url:1521:sid</code>

should probably be:
<code>jdbc racle:thin:@url:1521:sid</code>

The trailing colon after then caused me all kinds of headaches when I tried setting up Oracle 9.2.0.1.0 with Tomcat 5.0.27 regular pooling.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate 2.1 and Oracle 9.2.0.4 connection