You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Philippe Couas <pc...@infodev.fr> on 2005/03/09 12:29:20 UTC

sun.jdbc.odbc.JdbcOdbcDriver not found ?

Hi,
 
I use Tomcat 4.1.31 with IBM JDK1.4.1 and
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); is not found why ?
It seems me ODBC is inside JDK ?
 
Regards
Philippe

 
 
<%@page contentType="text/html"%>
<%@page import="java.sql.*"%>
<%/*
 * dbReadData.jsp
 * 
 * @title JDBC JSP Demo
 * @author Melvin Dave P. Vivas
 * @email admin@pinoylahat.com
 * @version 1.0
 * @requirements: Tomcat 4.0, SUN JVM 1.3.1
 */
%>
<html>
<head><title>Reading Data from an Database and Displaying using
JSP</title></head>
<body>
 
<% System.out.println("T1");Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
   System.out.println("T2"); String url = "jdbc:odbc:AGI";
   Connection cn = DriverManager.getConnection(url);
  System.out.println("T3"); Statement stmt = cn.createStatement();
   ResultSet rs = stmt.executeQuery("SELECT * FROM IFPAYS");%>
  
  <TABLE align="center" border="1">
        <TR>
          <TD align="center"><FONT
face="arial"><STRONG>NAME</STRONG></FONT></TD>
          <TD align="center"><FONT
face="arial"><STRONG>AGE</STRONG></FONT></TD>
       </TR>
  <%while(rs.next()){%>        
       <TR>
          <TD align="left"><FONT
face="arial"><%=rs.getString("code")%></FONT></TD>
          <TD align="right"><FONT
face="arial"><%=rs.getString("age")%></FONT></TD>
       </TR>
 
  <%}%>
  </TABLE>
 
</body>
</html>

 
</body>
</html>

 
 
 
Philippe COUAS
Responsable Développement
INFODEV S.A.