creating one jdbc configuration file for the entire web applicaton
Joined: Oct 21, 2009
I am using netbeans IDE and mysql database for my development in servlet and JSP. I created a java class as it contains all the configuration code to connect to my db. In another java class file i wrote code to retrieve data from db and to display. And it is working absolutely fine. Even I am getting the display of records on the console. But when i am trying connect to db from servlet, I am getting SQLException stating no drivers found. As I want to use single database connection file and use it within the entire web-application.
Joined: Feb 23, 2009
Then the Driver has not been loaded. You might want to use a ServletContextListener and do all necessary steps there and then just pick up on those in your servlets.
You might also want to consider using JDBCSupport for your projects. It makes SQL interaction a lot easier.
JDBCSupport - An easy to use, light-weight JDBC framework -
Joined: Mar 05, 2010
i think your driver jars can be deployed to your web container(Tomcat may).
open your web container directory. example in tomcat:
check your jdbc driver jar is it in this path?
if not, redeploy the project with your ide..