configure apache with sql
Posted
by Chava
on Stack Overflow
See other posts from Stack Overflow
or by Chava
Published on 2009-09-20T16:27:14Z
Indexed on
2010/06/02
11:04 UTC
Read the original article
Hit count: 222
Hello, I am newly using Apache Tomcat6.0 I am unable to access sql database through my jsp and getting java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
Tried steps at http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
downloaded drivers mysql-connector-java-5.1.9 and mysql-5.0.85-win32 na dkept in tomcat\lib modified web.xml with context details but this didinot help me. Please suggest and provide steps if possible.
JSP code
Driver d = (Driver)Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection con=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:8080");
I am using sql server WampServer without a password and created databse and table successfully.
© Stack Overflow or respective owner