-->
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.  [ 3 posts ] 
Author Message
 Post subject: MySQL driver error
PostPosted: Mon Nov 13, 2006 4:11 am 
Newbie

Joined: Tue Nov 07, 2006 7:13 am
Posts: 9
Location: Barcelona
Hi there,

I am building my frist app with hibernate and mysql but eclipse keeps reporting me an error with the mysql driver.
I have downloaded all things from hibernate site and placed all jars into my application path. That means that I'm able to write the import statement of the mysql driver within a class of my application but when trying to use the console configuration I recive an error like:

Error while fetching children. Reason:
org.hibernate.console.HibernateConsoleRuntimeException
Problems while loading database drivers
org.gjt.mm.mysql.Driver
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver


Does anyone have an idea what is going on?
Could you tell me how should I fix it?

Thanks a lot for your help.

Blai

_________________
Veles e vents han mos desig complir faent camins dubtosos per la mar.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 15, 2006 7:35 am 
Newbie

Joined: Thu Nov 02, 2006 8:41 am
Posts: 13
Location: Argentina
hello

at first you shold change your J/driver because
org.gjt.mm.mysql.Driver is an old package distribution and show the correct Driver class
I don't remember but I believe is
com.jdbc.mysql.Driver or something like that

when you have your new distribution here I give you an hibernate.cfg.xml template:

<?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>
<property name="connection.username">userName</property>
<property name="connection.url">
jdbc:mysql://127.0.0.1:3306/<put you DB Name>
</property>
<property
name="dialect">org.hibernate.dialect.MySQLDialect</property>

<property name="connection.password">Password</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="show_sql">true</property>
<property name="myeclipse.connection.profile">
desa_connector
</property>
<property name="connection.pool_size">10</property>


<!-- Second-level caching -->
<property name="SecondLevelCacheEnabled">true</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<property name="QueryCacheEnabled">true</property>


<!-- MAPPING RESOURCES -->
<mapping resource="com/cyt/model/Generador.hbm.xml" />
...................

</session-factory>

</hibernate-configuration>


Top
 Profile  
 
 Post subject: did it !!! (Hibernate console configuration tool bug?)
PostPosted: Thu Nov 16, 2006 7:47 am 
Newbie

Joined: Tue Nov 07, 2006 7:13 am
Posts: 9
Location: Barcelona
Hi you there,

I have fixed the issue about my driver for MySQL. The whole thing goes as follows:

I am using eclipse to develop my first application with hibernate. I have the plugins for the hibernate tools but apparently some doesn't work properly. When using these tools for the hibernate console configuration I couldn't get through my application tree to the mysql connector jar. So I thought that just selecting the folder it would do. There the problem came.
By chance, today I could make my way to this jar file and now it is working just fine.

So my advice would be: when editing your hibernate console configuration with the proper hibernate tool make sure when you use "add jar/dir" button that you can browse your driver. Otherwise, if you only reach the folder, write down the full name of the jar file containing the driver yourself. If you don't it won't work.

Many thanks to all that helped me with it.

Regards,

Blai

_________________
Veles e vents han mos desig complir faent camins dubtosos per la mar.


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