Brian,
I had the very same problem with Oracle but I solved it. Basically the
servelt returned a bunch of garbage as an error message that starts with
jdbc classes zip for your db. Then I restarted the java web server with
jserv -javahome d:\orajdeveloper\java1.2 (telling it to use the java VM on
which I was testing the servlet, exactly in the same way as you did it).
After restarting the jws servlet worked, returning the data from oracle and
showing it on the web page. Conclusion: use the JDK that you developed and
tested on. Funny enough I was able to compile the class using the javac
-classpath.... option, but that didn't work.
Best regards,
Marko
-----Original Message-----
From: Brian Mrkonjic [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 27, 2000 18:35
To: [EMAIL PROTECTED]
Subject: Problem connecting to MS Access database on NT using ODBC
bridge
Hi,
I have encountered a problem when attempting to connect to a MS Access
database hosted on an NT Server running JRun using a servlet. I have created
an ODBC datasource for the Access database on the NT server.
I first used a simple Java program to connect to the database and output
some records from a table. It executed successfully.
I then used the identical code in a simple servlet. The code snippet for
connecting to the database is as follows:
// The name of the JDBC driver to use
String driverName = "sun.jdbc.odbc.JdbcOdbcDriver";
// The JDBC connection URL
String connectionURL = "jdbc:odbc:MyAccessDataSource";
try {
// Create an instance of the JDBC driver so that it has
// a chance to register itself
Class.forName(driverName).newInstance();
// Create a new database connection.
con = DriverManager.getConnection(connectionURL);
...
At this point in the execution, I get the following error message:
Exception! java.sql.SQLException: [Microsoft][ODBC Microsoft Access
Driver]General error Unable to open registry key 'DriverId'. at
sun.jdbc.odbc.JdbcOdbc.createSQLException(Compiled Code) at
sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:4246) at
sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:1136) at
sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:148) at
sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:167) at
java.sql.DriverManager.getConnection(Compiled Code) at
java.sql.DriverManager.getConnection(DriverManager.java:159) at
EmployeeList.query(EmployeeList.java:148) at
EmployeeList.doGet(EmployeeList.java:66) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:516) at
javax.servlet.http.HttpServlet.service(Compiled Code) at
com.livesoftware.jrun.JRun.runServlet(Compiled Code) at
com.livesoftware.jrun.JRunGeneric.handleConnection(Compiled Code) at
com.livesoftware.jrun.JRunGeneric.handleProxyConnection(Compiled Code) at
com.livesoftware.jrun.service.proxy.JRunProxyServiceHandler.handleRequest(Co
mpiled
Code) at com.livesoftware.jrun.service.ThreadConfigHandler.run(Compiled
Code)
Any help/insights would be appreciated,
Brian
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html