• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Sammy Bill
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?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate 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]...

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic