-->
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.  [ 6 posts ] 
Author Message
 Post subject: Hibernate quickstart failed with MySql
PostPosted: Tue Mar 02, 2004 1:18 pm 
Beginner
Beginner

Joined: Tue Mar 02, 2004 1:12 pm
Posts: 25
Location: Newcastle Upon Tyne
HI

I have MySql server version 4.0.15-NT on a Windows XP machine, and the mysql-connector-java-2.0.14-bin.jar JDBC driver. My hibernate.properties setting is:

## MySQL

hibernate.dialect net.sf.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class org.gjt.mm.mysql.Driver
#hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql://localhost/test
hibernate.connection.username root
hibernate.connection.password

But when I execute "ant eg", I get the following error:

[java] Setting up some test data
[java] java.lang.AbstractMethodError: com.mysql.jdbc.jdbc2.Connection.prepareStatement(Ljava/lang/String;I)Ljava/sql/PreparedStatement;
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:324)
[java] at net.sf.hibernate.util.GetGeneratedKeysHelper.prepareStatement(GetGeneratedKeysHelper.java:39)
[java] at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:246)
[java] at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:61)
[java] at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:524)
[java] at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:432)
[java] at net.sf.hibernate.impl.ScheduledIdentityInsertion.execute(ScheduledIdentityInsertion.java:29)
[java] at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:906)
[java] at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:839)
[java] at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:757)
[java] at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:720)
[java] at org.hibernate.auction.Main.createTestAuctions(Main.java:291)
[java] at org.hibernate.auction.Main.main(Main.java:365)
[java] Exception in thread "main"

Although the empty tables are created in the database. Can anyone help please? Why is it trying to use the com.mysql.jdbc driver when the properties is set to org.gjt.mm.mysql driver?

Regards
Arijit


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 03, 2004 1:23 am 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
Update your MySQL jdbc driver.
It probably doesn't contain these classes and thus the eorror


Top
 Profile  
 
 Post subject: RE: Hibernate quickstart failed with MySql
PostPosted: Wed Mar 03, 2004 4:40 am 
Beginner
Beginner

Joined: Tue Mar 02, 2004 1:12 pm
Posts: 25
Location: Newcastle Upon Tyne
drj wrote:
Update your MySQL jdbc driver.
It probably doesn't contain these classes and thus the eorror


But this driver works with standard JDBC calls, and with other services like OGSA-DAI. Does Hibernate use additional classes? If so, then how were the tables created?

Arijit


Top
 Profile  
 
 Post subject: Re: RE: Hibernate quickstart failed with MySql
PostPosted: Wed Mar 03, 2004 5:05 am 
Beginner
Beginner

Joined: Tue Mar 02, 2004 1:12 pm
Posts: 25
Location: Newcastle Upon Tyne
arijitm wrote:
drj wrote:
Update your MySQL jdbc driver.
It probably doesn't contain these classes and thus the eorror


But this driver works with standard JDBC calls, and with other services like OGSA-DAI. Does Hibernate use additional classes? If so, then how were the tables created?

Arijit



No, the update worked, thank you. The latest mySQL driver (mysql-connector-java-3.0.11-bin.jar) is working. Thank you.

Arijit


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 26, 2004 12:13 pm 
Newbie

Joined: Fri Mar 26, 2004 12:05 pm
Posts: 3
Exchanging mysql-connector-2.0.14 with mysql-connector-3.0.11 is only an option if you have a commercial licence from mysql for 3.0.11 connector or you publish your sourcecode. This is because mysql-connector-3.0.11 is licenced under GPL and not LGPL like hibernate.

Best regards,

Mika


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 29, 2004 4:50 am 
Beginner
Beginner

Joined: Tue Mar 02, 2004 1:12 pm
Posts: 25
Location: Newcastle Upon Tyne
Mika wrote:
Exchanging mysql-connector-2.0.14 with mysql-connector-3.0.11 is only an option if you have a commercial licence from mysql for 3.0.11 connector or you publish your sourcecode. This is because mysql-connector-3.0.11 is licenced under GPL and not LGPL like hibernate.

Best regards,

Mika


Not a problem - myGrid (where I am using it) is an open source project (please see http://www.mygrid.org.uk) - that should be sufficient, isn't it?

Cheers
Arijit


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