-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: Connecting to Oracle9i
PostPosted: Tue Dec 30, 2003 3:45 pm 
Newbie

Joined: Tue Dec 30, 2003 3:38 pm
Posts: 7
Location: Texas
I am having a bit of trouble trying to connect to an Oracle database. My configuration xml file looks like this.

<?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 name="jndi/ContactsSessionFactory">
<!-- properties -->
<property name="hibernate.connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>

<property name="hibernate.connection.url">
jdbc:oracle://localhost:1521
</property>
<property name="hibernate.connection.username">
system
</property>
<property name="hibernate.connection.password">
password
</property>
<property name="hibernate.dialect">
net.sf.hibernate.dialect.OracleDialect
</property>

<property name="hibernate.connection.pool_size">4</property>
<property name="hibernate.show_sql">true</property>
<mapping resource="contacts/ContactInfo.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Can anyone give me some hints as what the problem is? This is what is being spit out.

log4j:WARN No appenders could be found for logger (net.sf.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.

Thank you in advance.

p.s. This is my first time in using this tool, and so I am trying to test is to see if we will be using it in our next project.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2003 3:51 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Your logging system is not properly configured. Place a log4j.properties in your classpath root (there should be an example log4j.properties) in the hibernate distribution, so you can see the log.

Besides, you should use net.sf.hibernate.dialect.Oracle9Dialect if using Oracle9


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2003 3:52 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
First configure logging http://www.hibernate.org/119.html#A15
Don't set your properties on multiple lines and trim your line.
Code:
<property name="hibernate.connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>


should be
Code:
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2003 3:57 pm 
Newbie

Joined: Tue Dec 30, 2003 3:38 pm
Posts: 7
Location: Texas
Thanks for the reply gloeglm.

I think that OracleDialect extends Oracle9Dialect so I don't think that is the problem. As far as the Log4J stuff those are all warnings.

Thanks.

Rama


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2003 4:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
There is a reason why Oracle9Dialect is there, you should use it when using Oracle9.

You have to configure logging to see whats going on and which errors occur. I suggest you do that first.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2003 4:12 pm 
Newbie

Joined: Tue Dec 30, 2003 3:38 pm
Posts: 7
Location: Texas
You both are very correct! Thank you very much for you time.

Rama Ituarte


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2003 4:13 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
No Problem :) If you have got logging configured, and can't track the error down yourself, feel free to post some more :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2003 4:15 pm 
Newbie

Joined: Tue Dec 30, 2003 3:38 pm
Posts: 7
Location: Texas
Thanks, I probably will. ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.