-->
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.  [ 5 posts ] 
Author Message
 Post subject: A Bug?
PostPosted: Mon Apr 26, 2004 6:09 am 
Beginner
Beginner

Joined: Tue Mar 30, 2004 5:54 am
Posts: 22
Location: Bangalore
hibernate 2.1.2

I had the following configuration file ...

Code:
<?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>
      <!-- datasource connection properties -->
      <property name="hibernate.dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
      <property name="hibernate.driver_class">oracle.jdbc.driver.OracleDriver</property>
      <property name="hibernate.connection.url">jdbc:oracle:thin:@...</property>
      <property name="hibernate.connection.username">username</property>
      <property name="hibernate.connection.password">secret</property>
      <!-- dialect for Oracle 9 -->
      
      <property name="hibernate.show_sql">true</property>
      <property name="use_outer_join">true</property>
      <!-- property name="hibernate.use_outer_join">true</property -->
   
      <mapping resource="Organisation.hbm.xml"/>
      <mapping resource="Budget.hbm.xml"/>
      <mapping resource="CostElements.hbm.xml"/>
   </session-factory>
</hibernate-configuration>



The error I was getting is ...

[DEBUG] DriverManagerConnectionProvider - -opening new JDBC connection
[WARN] SettingsFactory - -Could not obtain connection metadata <java.sql.SQLException: No suitable driver>java.sql.SQLException: No suitable driver


After lots of confusion I dicided to put a hibernate.properties

Code:
hibernate.dialect                   = net.sf.hibernate.dialect.Oracle9Dialect
hibernate.connection.driver_class   = oracle.jdbc.driver.OracleDriver
hibernate.connection.url            = jdbc:oracle:thin:@...
hibernate.connection.username       = username
hibernate.connection.password       = secret


and it WORKED.

Basically both have the same information.

Just curious about it ... is it a bug or I have any problem in my hibernate.cfg.xml file.

_________________
Thanks
Irfani


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 26, 2004 6:12 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
be carefull when talking about "bug" ....
i think the bug is in your dev environment since most of people are using hibernate.cfg.xml....


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 27, 2004 4:53 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
extra space probably

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 27, 2004 7:59 am 
Beginner
Beginner

Joined: Tue Mar 30, 2004 5:54 am
Posts: 22
Location: Bangalore
Sorry if I have hurt by the word Bug ... but I tried almost everything ... and finally decided to go for teh properties file.

One more thing ... the same hibernate.cfg.xml file is working fine if I use DataSource instead.

As per extra space is concerned ... I did checked ... it wasn't.

_________________
Thanks
Irfani


Top
 Profile  
 
 Post subject: Re: A Bug?
PostPosted: Sun May 02, 2004 11:24 pm 
Newbie

Joined: Sun May 02, 2004 11:16 pm
Posts: 1
In your XML configuration file, you use "hibernate.driver_class" as the property name. It should be "hibernate.connection.driver_class." I've had similar problems. It would be nice if Hibernate used a distinct XML tag or attribute for each property, or if it at least reported on unrecognized properties that it finds in the configuration file.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.