Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sql driver with hibernate

 
Gopu Akraju
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using hibernate to write data into mysql database. I get the following error.



I have used hibernate3.jar. I tried the following jars.

1. mysql-connector-java-3.1.11-bin.jar
2. mysql-connector-java-3.1.7-bin.jar
3. mysql-connector-java-3.0.17-ga-bin.jar

But all three of them failed? Do I need anything other jar file apart from hibernate3.jar and mysql connector jar? Please let me know.
Thanks.
 
Gopu Akraju
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my hibernate.cfg.xml as follows.



Anything wrong in the syntax? Thanks.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<property name="connection.url">mysql.url=jdbc:mysql://DGDS03/test</property>

That looks suspicious. I've never seen a JDBC URL with an '=' symbol in it. Sure it shouldn't just be jdbc:mysql://DGDS03/test ?
 
Gopu Akraju
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul. That worked.

My hbm.xml file is as follows:


I get my exception as follows.



I am trying to add two strings (i.e, testNum and testLane) into my table test.

I have created a table test with two columns as RunNum and Control both of VARCHAR(30) datatype.


The place where I call commit in my java class is as follows:


Why am I getting this exception? Thanks.
[ June 27, 2008: Message edited by: Gopu Akraju ]
 
g wildin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybeit appears because you are trying to save a String which does not have a mapping so Hibernate doesn't know how to save it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic