[英]Java JDBC Oracle 9i upgrade to 10g issues
We have just upgrade from oracle 9i to 10g and a database query I have works with the 9i client but not the 10g. 我们刚刚从oracle 9i升级到10g,并且数据库查询与9i客户端一起工作,但与10g无关。 Nothing in the query has changed.
查询中的任何内容都没有更改。 I get the following error:
我收到以下错误:
java.sql.SQLException: ORA-01036: illegal variable name/number
Not really sure what is going on. 不太确定发生了什么。 Why wouldn't it run anymore.
为什么它不再运行了。 It's just a select statement which joins about 3 or 4 tables.
这只是一条选择语句,它联接了大约3或4个表。 I am making sure that I am passing in the variable using setInt (it's a number that I'm using).
我确保使用setInt传递变量(这是我正在使用的数字)。 While diff'ing the tables being joined the only thing I find different is that on one table a column I'm joining is set to be a Number on one table and Number(12) on the other.
在比较要联接的表时,我发现的唯一不同之处在于,在一个表上,我要联接的列设置为一个表上的Number以及另一个表上的Number(12)。 Does this make a difference?
这有什么不同吗? The query still runs in TOAD and SQL Navigator...
该查询仍在TOAD和SQL Navigator中运行...
2 thoughts spring to mind: 我想到了两个想法:
Also, from experience if your database is big/busy you've got a fair way to go before your 10g environment is stable. 同样,从经验来看,如果您的数据库很大/很忙,在10g环境稳定之前,您还有一段公平的路要走。 My recommendations:
我的建议:
The problem was with the following method call on the prepared statement: 问题在于对准备好的语句的以下方法调用:
ps.setEscapeProcessing(false);
Removed that and now it works fine. 删除它,现在可以正常工作了。 Don't think that was compatable with oracle 10g driver.
不要认为这与oracle 10g驱动程序兼容。 Thanks everyone for the help.
谢谢大家的帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.