Hi.
1)
New to JDBC, the following code which I use to connect Java with
MSAccess generates the message: "[Microsoft][ODBC Driver Manager]
Invalid cursor state". The line generating the error is:
System.out.println("READ=" + IS.read());
Any ideas?
2)
if you know about any good JDBC links, FAQ's etc. - please tell me.
Many thanks
Shay.
import java.sql.*;
import java.io.*;
public class Coffee2{
public static void main(String args[]) {
String url = "jdbc:odbc:CafeJava";
Connection con;
Statement stmt;
InputStream IS = null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(java.lang.ClassNotFoundException e) {}
try {
con = DriverManager.getConnection(url, "Admin", "duke1");
stmt = con.createStatement();
ResultSet RS;
RS=stmt.executeQuery("select SUP_ID from COFFEES");
IS = RS.getAsciiStream(1);
try{
System.out.println("READ=" + IS.read());
}catch(Exception e){System.out.println("ERR" + e);}
stmt.close();
con.close();
} catch(SQLException ex) {System.err.println("SQLException: " +
ex.getMessage());}
}
Quote:}