Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect

 
harsimran kochar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
table tr has only 2 column 1st is time period of type text nd second is rate also of type text


 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch! I've added code tags to your post to make it easier to read.

Regardless of how many columns the table has, you are only returning one in the query (rate.) This means when you call getString(2), it doesn't know what to do.

 
harsimran kochar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so what should i do, can you suggest any change in code
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change the select to return both columsn. For example,

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or, alternatively, use

to get the one and only column you selected. If that was what you wanted.
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic