Hi,

I am a newbie in Java. I have written following code to use the scrollable
resultset.When I run the compiled class file it gives me following error.

Exception in thread "main" java.lang.UnsupportedOperationException at
sun.jdbc.odbc.JdbcOdbcConnection.createStatement(JdbcOdbcConnection.java.1018)


Does any body know how to make this feature work?

Thanks.
Kiran

- My Code---

import java.sql.*;
import java.io.*;
public class T1
{
public static void main(String[] args)
throws SQLException,IOException,ClassNotFoundException
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn =
DriverManager.getConnection("jdbc:odbc:uat","works","works");

Statement stmt;
System.err.println("Connected.");
//Statement stmt =
conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery("SELECT * FROM TAB");
System.err.println("Created");
//PreparedStatement stmt = conn.prepareStatement("SELECT * FROM TAB");
//ResultSet rs = stmt.executeQuery();

rs.afterLast();
while (rs.previous())
{
System.err.println("The Table name is " + rs.getString("TNAME"));
}

}
}



________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to