• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with jdbc driver

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm learning java and now i'm at the chapter with hibernate.
I started by downloading the source and put the jar content in the folder required in my lib directory.
My jar mysql_connector_java is under the directory lib in my lib tomcat folder.

Every jar are added in the java build path

I added the hibernate.cfg.xml file with this



I tried to connect me in console in mysql and it works with: mysql -u root
I created my database gestImmo and a table user.

here i'm the next step, add hibernate mapping file and i have an issue in eclipse (i'm using mac os x lion):



In front of Driver: com.mysql.jdbc.Driver
database URL : jdbc://mysql://localhost/gestImmo
username : root
password :

When i click refresh to see my available tables i've the following error:
this is most likely due to the url not matching the expected value by the jdbc driver. please verify your setting



thanks a lot for your help
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That database URL doesn't look correct. Here's a link to the documentation on the MySQL site: http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html.
 
fabian verbeek
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
great reply and fast.

thanks a lot, the correct url was : jdbc:mysql://localhost:3306/gestImmo
 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
3306 is the MySql default port. Remember that if you ever change the port in MySql config, to also update the connection strings.

WP
 
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic