This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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: 37180
515
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: 37180
515
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: 22374
42
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: 5167
11
Java Netbeans IDE Opera
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!