java sql in无效数字_java.sql.SQLException: ORA-01722: 无效数字

[eStore]2011-12-15 13:47:21,890 ERROR Probably an exception caught by Spring MVC, check the debug info which may help identifying the error. | reportError_jsp._jspService(121)

[eStore]2011-12-15 13:47:21,890 ERROR Detailed JSP Exception: | reportError_jsp._jspService(125)

org.hibernate.exception.SQLGrammarException: could not execute query

at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)

at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)

at org.hibernate.loader.Loader.doList(Loader.java:2216)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

at java.lang.Thread.run(Thread.java:595)

Caused by: java.sql.SQLException: ORA-01722: 鏃犳晥鏁板瓧

经过多次测试发现:

String hql="from Customer t where t.telephone='"+tel+"'";//可以

String hql="from Customer t where t.telephone="+tel;//报错

查原因:估计是oracle会将变化一下where to_numer( t.telephone)。

所以出现以上错误,转化一下试试

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值