Answer the question
In order to leave comments, you need to log in
Why is an error displayed when adding a record in MS SQL?
There is a piece of code. (JAVA)
sql = "SET NOCOUNT OFF INSERT INTO USER_INFO_TCC (USR_LAST_NAME,USR_FIRST_NAME,USR_MIDDLE_NAME,USR_EMAIL,USR_UDF_ADLOGIN,USR_UDF_START_DATE,USR_UDF_END_DATE,USR_UDF_JOBPOSITIONNAME,USR_UDF_PERSONNEL_NUMBER,USR_UDF_ORG_UNIT,USR_UDF_BALANCE_CODE) VALUES " +
"('"+USR.USR_LAST_NAME+"','"+USR.USR_FIRST_NAME+"','"+USR.USR_MIDDLE_NAME+"','"+USR.USR_EMAIL+"','"+USR.USR_UDF_ADLOGIN+"',"+USR_UDF_START_DATE_TCC+","+USR_UDF_END_DATE_TCC+",'"+USR.USR_UDF_JOBPOSITIONNAME+"','"+USR.USR_UDF_PERSONNEL_NUMBER+"','"+USR.USR_UDF_ORG_UNIT+"','"+USR.USR_UDF_BALANCE_CODE+"')";
System.out.println(sql);
TCCBDSt.executeQuery(sql);
Answer the question
In order to leave comments, you need to log in
executeQuery is called for SELECT queries that return result sets.
In your case, you need to use executeUpdate, which is for UPDATE INSERT DELETE commands that result sets don't return.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question