Hello Brian,
When you run the program as an application, do u run it on the NT box
independent of the JRun server? If yes, what version of JRun are you
running. It could be an allaire code problem with a work around. Go to the
site www.allaire.com which makes JRun and check website support for any
related issues.
Deepak
-----Original Message-----
From: Brian Mrkonjic [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 28, 2000 8:08 AM
To: [EMAIL PROTECTED]
Subject: Re: Problem connecting to MS Access database on NT using ODBC
bridge
Hi Rajesh,
Yes, the datasource is defined on the server. If I run the same code as a
Java program, on the server, it connects to the databse successfully. If I
run the code from within a servlet, on the same server, it gives me an
error.
Brian
>From: "SHEDDE, RAJESH" <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: Problem connecting to MS Access database on NT using ODBC
> bridge
>Date: Thu, 27 Jul 2000 15:56:42 -0400
>
>Since the servlet is executing on the server, is the odbc datasource
>defined on
>the server machine ?
>
>
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>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(C
ompiled
>
>Code) at com.livesoftware.jrun.service.ThreadConfigHandler.run(Compiled
>Code)
>
>___________________________________________________________________________
>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
________________________________________________________________________
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