This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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


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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: problem to get integer value in MSAccess please help..
 
It's not a secret anymore!