Home Answers Viewqa JDBC java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.

 
 


chinmay
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
0 Answer(s)      a year and 7 months ago
Posted in : JDBC

String sql = "UPDATE emp_details SET empEname = ?, emailId = ?, guid =?, proximityCard =?, managerEmailId = ?, reviewerEmailId =?, clientEmailId = ?, iRaceRole = ?, iRaceBand = ?, projectCode = ?, location = ?, track = ?, domain = ?, cmpDOJ = ?, clientDOJ = ?, primarySkillSets = ?, secondarySkillSets = ?, externalCertification = ?, experience = ?, primaryContactNo = ?, secondaryContactNo = ?, extensionNo = ?, directNo = ?, passportNo = ?, passportValidUpto = ?, visaStatus = ?, validUpto = ?, dOB = ?, marriageAniversary = ?, localAddress = ?, permanentAddress = ?, emergencyPhoneNo = ? WHERE empId = ?";

PreparedStatement pst = connection.prepareStatement(sql);

      pst.setString(1, employeeInfo.getEmpName());
      pst.setString(2, employeeInfo.getEmailId());
      pst.setString(3, employeeInfo.getGuid());
      pst.setString(4, employeeInfo.getProximityCard());
      pst.setString(5, employeeInfo.getManagerEmailId());
      pst.setString(6, employeeInfo.getReviewerEmailId());
      pst.setString(7, employeeInfo.getClientEmailId());
      pst.setString(8, employeeInfo.getiRaceRole());
      pst.setString(9, employeeInfo.getiRaceBand());
      pst.setString(10, employeeInfo.getProjectCode());
      pst.setString(11, employeeInfo.getLocation());
      pst.setString(12, employeeInfo.getTrack());
      pst.setString(13, employeeInfo.getDomain());
      pst.setDate(14, employeeInfo.getcmpDOJ());
      pst.setDate(15, employeeInfo.getclientDOJ());
      pst.setString(16, employeeInfo.getPrimarySkillSets());
      pst.setString(17, employeeInfo.getSecondarySkillSet());
      pst.setString(18, employeeInfo.getExternalCertifications());
      pst.setInt(19, employeeInfo.getExperience());
      pst.setString(20, employeeInfo.getPrimaryContactNo());
      pst.setString(21, employeeInfo.getSecondaryContactNo());
      pst.setInt(22, employeeInfo.getExtensionNo());
      pst.setString(23, employeeInfo.getDirectNo());
      pst.setString(24, employeeInfo.getPassportNo());
      pst.setDate(25, employeeInfo.getPassportValidUpto());
      pst.setString(26, employeeInfo.getVisaStatus());
      pst.setDate(27, employeeInfo.getValidUpto());
      pst.setDate(28, employeeInfo.getdOB());
      pst.setDate(29, employeeInfo.getMarriageAniversary());
      pst.setString(30, employeeInfo.getLocalAddress());
      pst.setString(31, employeeInfo.getPermanentAddress());
      pst.setString(32, employeeInfo.getEmergencyPhoneNo());
      pst.setInt(33, employeeInfo.getEmpId());


     pst.executeUpdate();
View Answers









Related Pages:

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.