wood burning stoves 2.0*
The moose likes JDBC and the fly likes creating one jdbc configuration file for the entire web applicaton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "creating one jdbc configuration file for the entire web applicaton " Watch "creating one jdbc configuration file for the entire web applicaton " New topic
Author

creating one jdbc configuration file for the entire web applicaton

kaustubh kurambhatti
Greenhorn

Joined: Oct 21, 2009
Posts: 13
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.
Please help
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
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 -
Jinglong Wang
Greenhorn

Joined: Mar 05, 2010
Posts: 12
hi,
i think your driver jars can be deployed to your web container(Tomcat may).

open your web container directory. example in tomcat:
x:\tomcat\webapps\your context\WEB-INF\lib\
check your jdbc driver jar is it in this path?
if not, redeploy the project with your ide..
try..
good luck..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: creating one jdbc configuration file for the entire web applicaton