aspose file tools*
The moose likes JDBC and the fly likes java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect" Watch "java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect" New topic
Author

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

harsimran kochar
Greenhorn

Joined: Sep 09, 2011
Posts: 14
table tr has only 2 column 1st is time period of type text nd second is rate also of type text


Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29219
    
135

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.



[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
harsimran kochar
Greenhorn

Joined: Sep 09, 2011
Posts: 14
so what should i do, can you suggest any change in code
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29219
    
135

Change the select to return both columsn. For example,

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18113
    
    8

Or, alternatively, use

to get the one and only column you selected. If that was what you wanted.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4522
    
    5

harsimran , please BeForthrightWhenCrossPostingToOtherSites : http://www.java-forums.org/database/48338-java-sql-sqlexception-microsoft-odbc-microsoft-access-driver-count-field-incorrect.html


luck, db
There are no new questions, but there may be new answers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect
 
Similar Threads
Connecting to a database through servl
hide email and password on contactus jsp
JQuery table manipulation
Data source name not found and no default driver specified
Edit/Delete values in database using jsp