java.sql.SQLException: ORA-00928: missing SELECT keyword. when inserting record to DB using JDBC
I can spot two problems:
- No need for single quotes around column names. But you may wrap it in double quotes. It is necessary if you are using reserved keywords for column names or table names. Here
DATE
. - You need a space before
VALUES
.
So you need to change insertStmt
to somthing like this:
String insertStmt = "INSERT into " + "MY_TABLE(RECORD_TYPE, FILE_TYPE, \"DATE\", BATCH_NO, RECORD_COUNT) " + "VALUES(?, ?, ?, ?, ?);";