tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emir Alikadic (ADNOC IS&T)" <ealika...@adnoc.com>
Subject RE: JSP JDBC MSSQL configuration
Date Wed, 05 Sep 2001 03:30:00 GMT
Is your database physically located on the same server as Tomcat?  If not,
it should be if you're to use JDBC:ODBC bridge without RMI extensions.
If they're split, you can either can a "real" JDBC driver (preferably Type
4) and then can connect to any database anywhere (subject to JDBC features
implemented in the driver), or you can get RMI-extended JDBC:ODBC driver
(see JDBC FAQ on JavaSoft's site).

Regards,



Emir.

> -----Original Message-----
> From: Randy Layman [mailto:randy.layman@aswethink.com]
> Sent: Tuesday, September 04, 2001 5:45 PM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: JSP JDBC MSSQL configuration
> 
> 
> 
> 	This is a guess, but I believe that your ODBC source is 
> set up as a
> user ODBC, however IIS isn't running as your user.  You need 
> to be on the
> System DSN tab when you create the source.
> 
> 	Also, if this is for anything more than a school assignment, you
> probably want to drop the JDBC-ODBC bridge - its not thread 
> safe and will
> crash Tomcat in certain not hard to get cases.  You can find more
> information about it in Sun's Bug Parade.
> 
> 	Randy
> 
> > -----Original Message-----
> > From: Robert Turner [mailto:rturner003@yahoo.co.uk]
> > Sent: Tuesday, September 04, 2001 9:23 AM
> > To: tomcat-user@jakarta.apache.org
> > Subject: 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
> > 
> 

Mime
View raw message