I get the following error while running a servlet that connects with database.Required:java.sql.Connectionfound:ConnectionThe line is Connection con = DriverManager.getConnection("here the oracle datasource ","user",password");//Note:before installing Tomcat the code gave no error:Pls give me suggestion

Questions by mythilikumar

Showing Answers 1 - 2 of 2 Answers

wht do u mean by: before installing Tomcat, the code gave no error, how were u executing the code prior to tomcat?The common steps are listed for cross-confirmation.Load the driver thru: Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); or wht ever driver type (thin/thick etc.) u want to use.Make a connection thru:Connection con = DriverManager.getConnection(url,"userName", "password");note: make sure to import java.sql package

  Was this answer useful?  Yes

kiranbanala

  • Apr 16th, 2006
 

probabilly classes12.jar file is not there in case of oracle in tomcat shared / lib folderin case of some other database copy its jar filesfor mysql copy mysql-connector-java-3.1.8-bin

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions