Hello,
I am new to creating Java web applications and came across this problem when trying to interact with my database (called ccdb) through my application:
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/ccdb/
My application runs on JBoss and uses Hibernate to interact with the MySQL database. I have the MySQL Driver in lib\mysql-connector-java-5.1.6-bin.jar of my project and I have the .jar configured in Eclipse as a "Java EE Module Dependency" so that it gets copied over to web-inf\lib\ when I deploy it to JBoss through Eclipse. I double checked and the driver is definitely in the .war file with the project, so it should be findable, right?
My hibernate.cfg.xml contains this line which should point hibernate to the driver.
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
Does anyone know what I need to do to get this to work? Do I have to configure the MySQL database as a JBoss datasource for it to work?
Thanks in advance.
Edit: kauppi's solution works, but I would prefer to have it in lib\ with the other jars, and I'm really curious as to why it won't work that way. Any ideas...?