Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

java.sql.SQLException: No suitable driver found for jdbc:mysql:servername/omb10

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I just finished developing and application in my local server using Struts 2 and hibernate 3.

so when i moved it to a public server, I went to the Hibernate.cfg.xml and change the properties there.
i changed <property name="hibernate.connection.url">jdbc:mysql:localhost/omb10</property>

to <property name="hibernate.connection.url">jdbc:mysql:servername/omb10</property>

that is all i changed.

I have mysql.jar in my /projectName/WebContent/WEB-INF/lib and i went to the server's lib directory and put mysql.jar and hibernate3.jar there.

then restarted tomcat but i get

java.sql.SQLException: No suitable driver found for jdbc:mysql:servername/omb10

any help?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I have mysql.jar in my /projectName/WebContent/WEB-INF/lib


I don't think you'll need it in there. The DataSource is created by the container not your application

Also, "jdbc:mysql:servername/omb10" doesn't look like a valid url for MySQL. Fomr the Connector/J docs:


The JDBC URL format for MySQL Connector/J is as follows, with items in square brackets ([, ]) being optional:

jdbc:mysql://[host][,failoverhost...][:port]/[database] ยป
[?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]...


 
Stop it! You're embarassing me! And you are embarrassing this tiny ad!
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic