I have a problem when I try to make database calls from a web application.
I'm using a javabean to make these calls.
I have already tested this bean, and it is working in classical application (i mean: not a web application).
I tried to use it in a jsp pages, but it didn't work. I got an exception:
>java.sql.SQLException
No suitable driver found for jdbc:mysql://localhost:3306/db_hafic?relaxAutoCommit=true
I read articles about how to make database calls from within tomcat environment, but I'm still quite lost.
I'm using jsp/tomcat/mysql.
解决方案
First read the documentation:
Install the .jar file(s) containing the JDBC driver in Tomcat's
common/lib folder. You do not need to put them in your application's
WEB-INF/lib folder. When working with J2EE DataSources, the web
application server manages connections for your application.