I got error \"Column not found\" any time i run the following code even though the column exist in my table. Am using access database, Appealing for help please
Try this...
class Trial1 {
public static void main (String[]args){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:SENSOR";
String user = "";
String pass = "";
Connection con = DriverManager.getConnection(url,user,pass);
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt.executeQuery("select MAX(LevelNum) as LEVELNUM from NList");
if (rs.next()){
int w = rs.getInt("LEVELNUM");
int x= 3;
double i = Math.pow(2, (w-x))-1;
System.out.printf("i is %f",i);}
stmt.close();
con.close();
}catch(Exception e)
{
System.out.println("Error" + e);
}
}