SQL statement execution error Solution

Source: Internet
Author: User

I am ashamed to say that I always make some small mistakes and struggle for a long time. This should not be a semicolon!
When an error occurs, the message is as follows:
Java code
[Default] [11:35:58, 552] [ERROR]
Java code
[Com. primeton. common. connection. impl. synchronization. TraceLoggerStatementSynchronization: 49]
Java code
SQL [INSERT INTO ASE_SYSTEM_LOG (LOGID, USERID, USERNAME, LOGINTIME) VALUES (?,?,?);] Execute error.
Java. SQL. SQLException: ORA-00911: invalid characters
The program code is as follows:
Java code
Copy codeThe Code is as follows:
String SQL = "INSERT INTO ASE_SYSTEM_LOG (LOGID, USERID, USERNAME, LOGINTIME) VALUES (?,?,?,?); ";
Con = this. getDataSource (). getConnection ();
Ptt = con. prepareStatement (SQL );
Ptt. setLong (1, logId );
Ptt. setLong (2, userId );
Ptt. setString (3, userName );
Ptt. setString (4, loginDate );
Ptt.exe cuteUpdate ();

When the ptt. excuteUpdate () method is executed, the preceding error is reported.
I thought it was a problem with the parameter assignment in SQL, But I copied the SQL statement directly to PLSQL for execution, but there was no problem. After a long time, it turned out to be
Copy codeThe Code is as follows:
"Insert into ASE_SYSTEM_LOG (LOGID, USERID, USERNAME, LOGINTIME) VALUES (?,?,?,?); "

There is another ";", so it's just me. I'm speechless !!!
Well, if you have a problem reporting character exceptions, you can refer to it. If you don't have a problem, never make such a low-level error again!
Tell yourself one sentence: Not careful is a bad program.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.