I am getting an exception (java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state)
while running this program given below. Please help.
import java.sql.*; import java.io.*; class Dbconnect1 { public static void main(String[] args) { String str[]={"Yahoo","Yah"}; try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc;dbc:db"); String query="Select distinct id from employee"; Statement st=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); ResultSet rs = st.executeQuery(query); rs.beforeFirst(); Boolean b; while(rs.next()) { System.out.println(rs.getInt(1)); if(rs.isLast()) break; } st.close(); con.close(); } catch(Exception e) { e.printStackTrace(); } System.out.println("Hello World!"); } }