Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem to get integer value in MSAccess please help..

 
Rohan Patel
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try {

//String a=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbcdbc:newtest");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from department");
while (rs.next()) {
department.Deptbean u1 = new department.Deptbean();
// a=rs.getString(1);
u1.setDept_id(rs.getString(1));
u1.setName(rs.getString(2));//Problem in this statement
//cant get integet value & rs.getInt() not working

listd.add(u1);
System.out.println("Prob"+rs.getString(1));
}

} catch (Exception ex) {
System.out.println("Prob:"+ex.toString());






Exception is
Prob:java.sql.SQLException: No data found
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic