• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i am having the same problem can you tellme how you got around this issue.
Thank you
Fred
 
reply
    Bookmark Topic Watch Topic
  • New Topic