You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Robert Turner <rt...@yahoo.co.uk> on 2001/09/04 15:22:58 UTC

JSP JDBC MSSQL configuration

I am trying to connect to a MSSQL database withi a JSP
page and I am find documentation a little woolly.

Firstly I created a OBDC connection called 'Phone',
which I tested when I set it up and it said it was
successful. I also tried it out within an MS Access
database and again it worked fine, linking a SQL table
nicely.

My setup is that I am using IIS5 which has linked to
it a Tomcat 3.2.3 server. This set up seems to be
functioning correctly and the examples are running.

The code in my JSP file is as follows

[%@ page language="java" import="java.sql.*" %]
[%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection
myConn=DriverManager.getConnection("jdbc:odbc:Phone");

Statement stmt=myConn.createStatement();
String query="SELECT * FROM Misc_Numbers ORDER BY
Description";

ResultSet rs=stmt.executeQuery(query);

The result I get in the browser is:

Error: 500

Location:/jsp/index.jsp

Internal Servlet Error:

Javax.servlet.ServletException: [Microsoft][ODBC
Driver Manager] Data source name not found
..................

Can anyone suggest what my problem is?

Robert T Turner
rturner003@yahoo.co.uk

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie