Hi all,
I am using Access2000 and
JDBC to update a record. I am using a PreparedStatement in order to pass new values to the DB.
public static
String UPDATE_BUILDER = "UPDATE BuilderInfo SET BuilderName ='?', Address='?', City='?', State='?', Zip=?, " +"Phone='?', Fax='?', Pager/Cell='?', ContractorName ='?', ContactName='?' WHERE BuilderID =?";
Class.forName(driver);
Connection conn = DriverManager.getConnection(url, userid, passwd);
PreparedStatement stmt = conn.prepareStatement(UPDATE_BUILDER);
stmt.setString(1, bName);
stmt.setString(2, bAddress);
stmt.setString(3, bCity);
stmt.setString(4, bState);
stmt.setLong(5, Long.parseLong(bZip));
stmt.setString(3, bPhone);
stmt.setString(3, bFax);
stmt.setString(3, bMobile);
stmt.setString(3, bOwnerName);
stmt.setString(3, bCName);
stmt.setLong(5, Long.parseLong(bID));
stmt.executeUpdate();
Right before the stmt.setString(3, bCity); the program experiences a SQL error as follows:
Error - java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid argument value
What's wrong? Is it the code or Access? Any insight on this matter would be greatly appricated.
Thanks,
James