This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes problem to get integer value in MSAccess please help.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "problem to get integer value in MSAccess please help.." Watch "problem to get integer value in MSAccess please help.." New topic
Author

problem to get integer value in MSAccess please help..

Rohan Patel
Greenhorn

Joined: Jun 13, 2011
Posts: 4
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem to get integer value in MSAccess please help..
 
Similar Threads
how to improve my program code ?
setAutoCommit(false) not working
regarding Retrival of multiple values from db using result set
how to load the values in one object?
Problem in ResultSet