java.sql.SQLException: Column not found
843785Aug 11 2008 — edited Aug 12 2008hi ,
i encountered a problem while executing the following code.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:bandctech","sample","sample");
Statement st=con.createStatement();
ResultSet rst1=st.executeQuery("select max(sno) from staffdetail");
rst1.next();
so=rst1.getInt("sno");
while excution it shows:
java.sql.SQLException: Column not found
i have "sno" field in my table.
i even used:
ResultSet rst1=st.executeQuery("select sno from staffdetail");
rst1.next();
so=rst1.getInt("sno");
please suggest where i did wrong in the coding.
thank you