tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Li" <...@MurraysDiscount.com>
Subject Can't get Tomcat to support JDBC 2.x API
Date Mon, 19 Mar 2001 14:04:40 GMT
I have problem to get Tomcat to support JDBC 2.0 API. The following code
runs work if I compile at DOS prompt using javac and and run the program
using java. But I got no class support error message when run in JSP. I have
tomcat 3.2.1 and JDK 1.3 installed.

--------------------------------------------------------------------
<%@ page import="java.sql.*"%>
<%
        Connection con = null;
        try{
                    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
	        con = DriverManager.getConnection("jdbc:odbc:internetdb", "", "");

	        Statement st =
con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
	        ResultSet rs = st.executeQuery("Select * from HRExt");
	        rs.last();
	        out.println(rs.getRow());
	        rs.close();
	        con.close();
        }
        catch(SQLException e){
	        System.err.println(e.getMessage());
        }
        catch(Exception e){
            System.err.println(e.getMessage());
        }
%>
---------------------------------------------------------------------

Thanks for any help
Jack Li


Mime
View raw message