garfield11
asked on
Load driver & getting a connection to db
Hi all,
I'm new in JSP and I encountered problems while loading the driver n getting a connection to the database.
Codes:
Class.forName( "com.microsoft.jdbc.sqlser ver.SQLSer verDriver" );
Connection conn = DriverManager.getConnectio n (
"jdbc:microsoft:sqlserver: OTsoft",
"sa", "" );
But it results in "No suitable driver".
Currently using Microsoft SQL Server - Enterprise Manager for database.
Can anyone please advise? Thanks!
I'm new in JSP and I encountered problems while loading the driver n getting a connection to the database.
Codes:
Class.forName( "com.microsoft.jdbc.sqlser
Connection conn = DriverManager.getConnectio
"jdbc:microsoft:sqlserver:
"sa", "" );
But it results in "No suitable driver".
Currently using Microsoft SQL Server - Enterprise Manager for database.
Can anyone please advise? Thanks!
Do you set the CLASSPATH point to the jar file of jdbc driver?
ASKER
yup. Under JPadPro menu, I select "Edit Standard Classpath"-->"Add" and enter C:\tomcat\lib\servlet.jar.
No, I believe kotan is asking if you have the path to the JDBC driver jar in your classpath.
if you don't have it in your classpath, add it.
if you haven't gotten/downloaded the SQL Server JDBC driver.. you can get it from here:
http://msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?url=/MSDN-FILES/027/001/779/msdncompositedoc.xml
CJ
if you don't have it in your classpath, add it.
if you haven't gotten/downloaded the SQL Server JDBC driver.. you can get it from here:
http://msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?url=/MSDN-FILES/027/001/779/msdncompositedoc.xml
CJ
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Add the jar file for your JDBC driver to the directory:
<webapp>/WEB-INF/lib
<webapp>/WEB-INF/lib
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
"Accept cheekycj's comment as answer."
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Kuldeepchaturvedi
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
"Accept cheekycj's comment as answer."
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Kuldeepchaturvedi
EE Cleanup Volunteer