mybatis项目报错:java.sql.SQLException: ORA-00911: 无效字符 解决方法

如果你用java写进程访问数据库,出现这个问题:
java.sql.SQLException: ORA-00911: 无效字符

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:799)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1037)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)
at oracle.jdbc.driver.OracleStatement.doScrollExecuteCommon(OracleStatement.java:4051)

 

百度了下:网上达人们给出如下解决方法: 

 原因是:你的sql多了一个";" 去掉就可以了 

但是,这只是针对单条语句的解决办法,如果是批处理,就算你不少‘:’也是不行的,我在PLSQL中试了一下,

如果写在一行是不行的,但是分行写是可以的,奇怪,黑线中~~,

又百度了一波,找到了解决办法,

在批处理外面套上 begin;....end;

完美解决,但是中间的语句也是不能少“;”的,不然还是会报错,切记!

关键词:java jdbc oracle driver 解决 oraclestatement cpreparedstatement nbsp sql ora

相关推荐:

java – 无效的列类型:没有为类oracle.jdbc.driver.T4CRowidAccessor实现getInt

Unable to correct error when inserting records into database using JDBC

Select specific columns from the table and save the results in the non-entity POJO with Spr...

Java.sql.SQLException: ORA-01005: null password given; Conne...

Spring Lot - Steps to Improve Performance

oracle中时间条件比较时报ORA-01830

Centos7下ELK+Redis日志分析平台的集群环境部署记录

Oracle Call & ldquo; DEFINE & rdquo; From Java

java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

Selecting the object list using HQL when the object is a property of another feature class