File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes SQLException: no data found - i can retrieve data, but not use it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQLException: no data found - i can retrieve data, but not use it" Watch "SQLException: no data found - i can retrieve data, but not use it" New topic
Author

SQLException: no data found - i can retrieve data, but not use it

Jon Dornback
Ranch Hand

Joined: Apr 24, 2002
Posts: 137
i'm having trouble with a jdbc-odbc connection to an access database. in a function, i call a sql query, initialize an array to the size of the query by using result.last() and then result.getRow(), and then use .beforeFirst() before i start looping through the resultset to add each row to the array. i have done this successfully before within the same program, but for some reason it is now giving me trouble. whenever i call the .getString("columnname") function and try to use the returned value as a parameter, or assign it to another variable, i get "java.sql.SQLException: No data found". code below. any help greatly appreciated.


use the [CODE] tags - it makes it much easier for people to help you.
Jon Dornback
Ranch Hand

Joined: Apr 24, 2002
Posts: 137
i found the problem: the jdbc-odbc driver requires that the columns are accessed in order. so, if in the db, the columns are "id,name,phonenumber" and in the code you try to getString("name"),getInt("id") it blows up.
Fred Abbot
Ranch Hand

Joined: Jun 01, 2000
Posts: 300
Hi i am having the same problem can you tellme how you got around this issue.
Thank you
Fred
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQLException: no data found - i can retrieve data, but not use it