Surely, with the new open community process, a focused effort could have
some impact on this now?

-----Original Message-----
From: Greg Ames [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 27, 2000 1:21 AM
To: [EMAIL PROTECTED]
Subject: Re: Dr. Watson is attacking my computer


The JdbcOdbcDriver is not thread safe and servlets are threaded.  I wish
someone from Sun/Javasoft realized the pain and suffering that this causes.
JdbcOdbcDriver can and should be fixed.  This is very subtle and VERY
annoying.  It sort of works sometimes.

Use the Oracle JDBC drivers and your problems will magically go away.

        String DRIVER_NAME   = "oracle.jdbc.driver.OracleDriver";
        String DB_NAME       =
"jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:DATABASE_NAME";
        String DB_USER_NAME  = "USER_NAME";
        String DB_PASSWORD   = "PASSWORD";

        Class.forName (DRIVER_NAME);

        con = DriverManager.getConnection( DB_NAME,
                                               DB_USER_NAME,
                                               DB_PASSWORD );
Good luck,

        Greg Ames
        [EMAIL PROTECTED]

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Steiner, Jeff
Sent: Wednesday, January 26, 2000 1:39 PM
To: [EMAIL PROTECTED]
Subject: Dr. Watson is attacking my computer


I am running JRun under Netscape Enterprise server in a Windows NT4.0
environment.  I have an access database that I am attempting to connect to
for testing purposes before sending the application to our production
servers which are running Oracle.  I can run the jsp once and it will
retrieve the information from the database and display it on the browser.
When I hit refresh, the good Dr. comes and shuts down the javaw.exe and I
get a connector Proxy error and have to restart JRun.

I am new to both Java and jsp, so please try not to laugh too hard when
viewing my code below.  I would appreciate any helpful tips or suggestions
regarding this problem.

TIA

Jeff Steiner

<%@ page language="java" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>

<html>
<body bgcolor="#ffffff">
<br /><br />
<%
    // Set default Connection and sql variables
    Connection dbCon;
        String sql;

        // Create the sql statement used to query the database.
        sql = "SELECT Content,DateModified,Active,ID FROM HotTopics";

        // Try to make a connection with the database through jdbc/odbc
    try {
          // Name the driver and then the datasource
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      dbCon = DriverManager.getConnection("jdbc:odbc:DealerServices");

          // Try to execute the query from above
          try {
            // Create the statement and recordset
            Statement s = dbCon.createStatement();
                ResultSet rs = s.executeQuery(sql);

                // Thisis a while loop that will iterate through the
                // return and display everything to the user.
                while (rs.next()) {
%>
<%= rs.getString("Content") %>
<%
        }
                }
                // This catch is used if the sql query was bad when it
executed.
            catch (SQLException e) {
                  //Catch SQL Exceptions here
                }
    }
        // This catch is done if you cannot connect to thedatabase.
    catch (ClassNotFoundException e) {
      //Catch error here
    }
        // This catch is done if the sql is bad.
        // Might be redundant.
    catch (SQLException e) {
      //Catch SQL Error here
    }
 %>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to