java.sql.SQLException: ORA-00911: invalid character

控制台抛出这个异常:java.sql.SQLException: ORA-00911: invalid character

查了一下说是oracle字符集设置的问题。我将抛异常的SQL语句在控制台输出如下:

select count(t.id) as onerowc,t.id as areatravelid ,b.id
as airpotid from base_areatravel t inner join base_airpot b on
b.areaid=t.id group by t.id ,b.id;

以上是完完整整的输出结果,然后我将语句复制到PL/SQL中执行是完全可以的,没有任何异常的。。

而我在程序中定义的sql如下:

String sql="select count(t.id) as onerowc,t.id as areatravelid ,b.id as airpotid from base_areatravel t"+

    " inner join base_airpot b on b.areaid=t.id group by t.id ,b.id;";

呵呵,花费了半个多小时终于找到原因::::

定义语句中sql后面多了一个分号。(“;”)晕菜。。这样的话在PL/SQL中是无所谓的,可是Java 的数据库驱动却不识别这样的语句了。汗,,,太大意了。记录下来防止再次犯错,呵呵。。。

java.sql.SQLException: ORA-00911: invalid character 解决方法的更多相关文章

  1. java.sql.SQLException: Io 异常: Invalid number format for port number

    java.sql.SQLException: Io 异常: Invalid number format for port number   jdbc数据库链接配置没有写端口号 ​ 要检查jdbc的配置 ...

  2. ORA-00911: invalid character解决方法

    今天在搭建VLS系统后,登录系统测试时发现点击菜单提示错误“ORA-00911:???”.网上很多是因为语句中带分号导致的,但是这次是点开菜单就报错,怀疑是字符集设置的问题. 参考网上的解决方案,添加 ...

  3. maven+springmvc出现:java.sql.SQLException: Unknown system variable 'query_cache_size'

    连接mysql时一直出现以下的错误: org.springframework.web.util.NestedServletException: Request processing failed; n ...

  4. Spring 连接MySQL报错java.sql.SQLException: Unknown system variable 'tx_isolation'

    先是报错255,这个时候需要把 jdbc:mysql://localhost:3306/projUse 写成 jdbc:mysql://localhost:3306/projUse?useUnicod ...

  5. java.sql.SQLException: Invalid parameter object type. Expected 'java.util.Map' but found 'java.lang.String 转载

    java.sql.SQLException: Invalid parameter object type. Expected 'java.util.Map' but found 'java.lang. ...

  6. Error getting nested result map values for 'company'. Cause: java.sql.SQLException: Invalid value for getInt() - 'NFHK188'

    我今天遇到一个我不解的问题,是mybatis多对一关系查询出问题了,但是我自己还是解决了,在网上也查过那个错误,可是找不到我想要的.不知道你们遇到过没有,我接下来分享给大家.希望我这个第一篇博客能帮助 ...

  7. java.sql.SQLException:Invalid value for getInt()-'zhangsan'

    1.错误描述 java.sql.SQLException:Invalid value for getInt()-'zhangsan' 2.错误原因 在遍历打印查询结果时,rs.getInt(3),而在 ...

  8. java.sql.SQLException: Unsupported character encoding 'utf8mb4'.

    四月 12, 2017 3:47:52 下午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() fo ...

  9. JDBC连接ORACLE无法登陆java.sql.SQLException: ORA-01017: invalid username/password; logon denied

    当用jdbc连接Oracle数据库的时候 private Connection getConnection() throws SQLException { OracleDataSource ods = ...

随机推荐

  1. fgtyn

    http://www.studiocleo.com/projects/ballettechnique/one_11.html

  2. Sqlserver 自定义表类型定义,使用,删除

    --创建用户自定义表类型CREATE TYPE dbo.CustomerTable AS TABLE ( Id int NOT NULL, Name char(10) NULL, PRIMARY KE ...

  3. MVC @Html.DropDownList()绑定值

    Controller中: ViewBag.modules = new SelectList(集合.ToList(), "下拉框键", "下拉框值"); View ...

  4. AIDL小结

    AIDL : Android Interface Define Language(接口定义语言) Service中跨进程间通信利器.... 一般都会有Client端和Server端(Server端提供 ...

  5. Ms sql行转列。汇总

    SQL行转列汇总 PIVOT 用于将列值旋转为列名(即行转列),在 SQL Server 2000可以用聚合函数配合CASE语句实现 PIVOT 的一般语法是:PIVOT(聚合函数(列) FOR 列 ...

  6. oracle的over函数应用(转载)

    摘自: http://www.poluoluo.com/jzxy/201004/81921.html 百度文库也记载了Oracle中over()分析函数的用法 在泡坛子的时候中无意中发现了这个函数,才 ...

  7. LeetCode-179. Largest Number

    179. Largest Number Given a list of non negative integers, arrange them such that they form the larg ...

  8. dojo GridX 用法

    1. 表格的加载显示 function CreateGrid() { var store = new dojo.store.Memory({ data: [ { id: 1, UserName: &q ...

  9. Foundation框架—数据类(NSData)

    一 NSData的使用 .string -> data     NSString *str = @"changxiangweilai";     NSData *data = ...

  10. RedHat6.5更新软件源

    今天在Red Hat上安装软件时,发现需要依赖软件,然而在用sudo yum指令时,出现了下面的错误: This system is not registered to Red Hat Subscri ...