Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQLException Data Not Found

843854Jan 5 2002 — edited Jan 8 2002
Hi everyone,

I am having a problem retrieving data from a SQl Server 2000 database. Below is the code
try {
dbURLStr = "jdbc:odbc:db_gellassoc";
Connection con = DriverManager.getConnection (dbURLStr, "", "");
Statement stmt = con.createStatement();

sqlStr = "Select * from tb_jobclass order by SortOrder;";
ResultSet rs = stmt.executeQuery(sqlStr);
Vector vGroupedListings = new Vector();
String test;
while(rs.next()) {
vJobClasses.addElement(rs.getString("JobClass").trim());
System.out.println(rs.getString("JobClass").trim());
}
catch(SQLException ex) {
System.out.println("SQLException " + ex.toString();
}

On the second call to rs.getString("JobClass"), I get the SQLException data not found. Can you not call getString on the same column twice in the same row?
Is it a problem with the JDBC driver?

I have also written a little Visual Basic program to update and add new records to this database and it works just fine.

Any help would be greatly appreciated.

Thanks in advance,
Greg
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 5 2002
Added on Jan 5 2002
4 comments
252 views