• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

sql driver with hibernate

 
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my hibernate.cfg.xml as follows.



Anything wrong in the syntax? Thanks.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Doody calls. I would really rather that it didn't. Comfort me wise and sterile tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic