I am new to creating Java web applications and encountered 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 a MySQL driver in lib \ mysql-connector-java-5.1.6-bin.jar of my project, and I have a .jar configured in Eclipse as a "Java EE module dependency" so that it is copied to the web inf \ lib \ when I deploy it to JBoss via Eclipse. I checked twice, and the driver is definitely located in the .war file with the project, so you need to find it, right?
My hibernate.cfg.xml contains this line, which should indicate hibernation on the driver.
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
Does anyone know what I need to do to make this work? Do I need to configure a MySQL database as a JBoss data source to work?
Thanks in advance.
Edit: the kauppi solution works, but I would rather have it in lib \ with other banks, and I am very curious why this will not work. Any ideas ...?
source
share