A couple of things I would change (which may or may not help though):

1) Call close() on result, statement and connection (in that order), after
you have finished with them - to make sure all resources used are freed up
immediately. Otherwise you'll find all available DB connections will get
eaten up in a short space of time.

2) You can safely place the the section that loads the JDBC driver into a
jspInit() method in the JSP - it only needs to be done once.

I have had a similar setups in the past give similar problems, though not
quite so extreme, however some work fine (different combinations/versions of
the various components?).

I do remember in one specific case that if I tried leaving the connection
open and re-using it across a number of requests, this did cause this
problem - opening/closing the connection each time fixed the problem, albeit
with the added overhead this entails.

Btw the JDBC-ODBC driver doesn't seem to have many fans...

HTH,

Steve S

> -----Original Message-----
> From: A mailing list about Java Server Pages specification
> and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Steiner, Jeff
> Sent: 26 January 2000 21:39
> 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

Reply via email to