why semicolon not allowed in JDBC Oracle?
801904Sep 24 2012 — edited Nov 20 2014hello everyone
consider this:
ResultSet rset = stmt.executeQuery ("select count(*) from Invoices;"); // note there is a semicolon at the end of SQL statement
Question: why does having a semicolon at the end of the SQL statement in JDBC (1.6, 1.7) for Oracle 11g database generates an error such as below:
Exception in thread "main" java.sql.SQLSyntaxErrorException: ORA-00911: invalid character
Once I remove the semicolon, the code works fine.
I always thought that ending all SQL statements with a semicolon was part of SQL standard and Oracle PL/SQL certaintly supports and encourages semicolons (and requires it in many cases).
So why does JDBC object to semicolons ?
Is there a JDBC Oracle driver setting/property that can be set to =true/=1 such that I can use semicolons at end of SQL statements ?
thanks.