tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 10249] New: - Tomcat hangs with Interclient JDBC driver
Date Wed, 26 Jun 2002 15:05:53 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10249>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10249

Tomcat hangs with Interclient JDBC driver

           Summary: Tomcat hangs with Interclient JDBC driver
           Product: Tomcat 4
           Version: 4.0.4 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: webmaster@cienciapura.com.br


I have an environment with multiple virtual hosts. One of my users put an 
Interclient JDBC driver in his area and after trying to use it, Tomcat hangs. 
The curious is that 'connectionless' JSP pages work fine. Servlets and JSP 
pages that tries to connect to other databases, like MySQL, hangs too. I had 
top restart Tomcat.

It might be a bug with JDBC2.0 or even in the driver, but I think Tomcat should 
be robust enough and harm other user's application.

Steps to reproduce:
- download the driver:
http://www.kpi.com.au/interbase/files/interclient.jar
( you don't need to have Interbase server running anywhere !!)

- servlet:
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class Interbase extends HttpServlet {

 public void doGet(HttpServletRequest req, HttpServletResponse res)
                               throws ServletException, IOException {

   Connection con = null;
   Statement stmt = null;
   ResultSet rs = null;

   res.setContentType("text/html");
   PrintWriter out = res.getWriter();

   try {

      Class.forName("interbase.interclient.Driver");

      Connection con = DriverManager.getConnection
("jdbc:interbase://localhost/data/mydb.gdb","SYSDBA","masterkey");
      stmt = con.createStatement();

      rs = stmt.executeQuery("SELECT * from users");

      out.println("<HTML>");
      out.println("<BODY>");
        while (rs.next()) {
         out.println(rs.getString(1));
      }
      rs.close();
      con.close();

      out.println("</BODY></HTML>");

    }
    catch(ClassNotFoundException e) {
      out.println("ERROR " + e.getMessage());
    }
    catch(SQLException e) {
      out.println("ERROR " + e.getMessage());
    }
    finally {
      // Always close the database connection.
      try {
        if (con != null) con.close();
      }
      catch (SQLException ignored) { }
      out.flush();
      out.close();
    }
  }
}

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message