Scott,
I am not writing class. I am simple wring a jsp page. the source codes are:
-----------------------------------------
<%@ 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());
}
out.println("Hello World");
%>
---------------------------------------------
Thanks,
Jack
-----Original Message-----
From: Scott Walter [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 18, 2001 11:28 AM
To: [EMAIL PROTECTED]
Subject: RE: How to get rs.last() supported by Tomcat
Tomcat will only look in the web-inf\classes and
web-inf\jar directories for classes. If the driver is
already packaged in a jar file place it in the
web-inf\jar directory, otherwise place it in
web-inf\classes.
If you have just the classes to the driver, make sure
the package structure remains intact under
web-inf\classes
You might have to restart tomcat for the effect to
take place.
--- Jack Li <[EMAIL PROTECTED]> wrote:
> Scott,
>
> I created the statment by using:
>
> "createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
> ResultSet.CONCUR_READ_ONLY)"
>
> I pointed JAVA_HOME to c:\jdk1.3. As I know, jdk3.0
> has JDBC 2.0 in it. When
> I used the javac to compile a similar program at DOS
> prompt and it worked
> fine. But the same code in JSP got no class error
> message. Do I need to
> install JDBC2.0 separately?
>
> Thanks,
> Jack
>
> -----Original Message-----
> From: Scott Walter [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, March 18, 2001 10:11 AM
> To: [EMAIL PROTECTED]
> Subject: Re: How to get rs.last() supported by
> Tomcat
>
>
> First of all are you using a JDBC 2.0 driver? How
> are you creating your statement object. By default
> statement objects are forward-only. You need use a
> onverloaded version of the createStatement() method
> to
> make it scrollable, which is needed for the last()
> method. Check the jdk api docs for the exact syntax
> of the overloaded createStatement() method.
>
> scott.
> --- Jack Li <[EMAIL PROTECTED]> wrote:
> > Hello,
> > I need help on JDBC 2.0.
> > I have Apache, Tomcat 3.2.1 and jdk1.3. But I
> can't
> > call JDBC 2.x methods
> > such as rs.last(). Any ideas?
> >
> > Thanks,
> > Jack
> >
>
>
> =====
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Scott
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>
=====
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Scott
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/