Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Jon Dornback
Ranch Hand
Posts: 137
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jon Dornback
Ranch Hand
Posts: 137
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 300
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am having the same problem can you tellme how you got around this issue.
Thank you
Fred
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic