| Author |
JDBC-ODBC with Access : Error in Execution
|
Ratheesh Narayanan
Ranch Hand
Joined: Oct 30, 2004
Posts: 38
|
|
Hi, I have an application which needs to be connected MS Access Database and fetch the information. I am using JDBC-ODBC Driver for that. I have a Prepared Statement like below: update product1 set DescriptionOne='20$ Off on next purchase' where ProductCode='0001' When I am executing the statement I am getting an error mentioned below: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2. If anyone came across the same error please let me know... Thanks, Ratheesh
|
SCJP 1.4 & SCBCD 1.5
|
 |
Ratheesh Narayanan
Ranch Hand
Joined: Oct 30, 2004
Posts: 38
|
|
Hi, I myself found a solution for this issue.. The problem is: whenever you execute a query against a table where a column name is space seperated you will face this problem. So put the column names in a square brackets and execute; the query will be executed successfully. Ratheesh
|
 |
mani senthil
Greenhorn
Joined: Jan 18, 2007
Posts: 17
|
|
|
SEND ME THE STRUCTURE OF THE DB AND THE PROGRAME
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26138
|
|
Ratheesh, Thanks for posting the solution so that others who see this thread in the future can benefit. Mani, Note that writing in all caps either implies that you are shouting or that your keyboard is broken with the caps lock key down.
|
[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
|
 |
 |
|
|
subject: JDBC-ODBC with Access : Error in Execution
|
|
|