Java JDBC Oracle 9i升级到10g问题
我们刚刚从 Oracle 9i 升级到 10g,我的数据库查询适用于 9i 客户端,但不适用于 10g。查询中没有任何变化。我收到以下错误:
java.sql.SQLException: ORA-01036: illegal variable name/number
不太确定发生了什么。为什么不再运行了。它只是一个连接大约 3 或 4 个表的 select 语句。我确保使用 setInt 传递变量(这是我正在使用的数字)。在比较要连接的表时,我发现唯一不同的是,在一个表上,我要连接的列设置为一个表上的数字,另一个表上的数字(12)。这有什么区别吗?该查询仍在 TOAD 和 SQL Navigator 中运行...
We have just upgrade from oracle 9i to 10g and a database query I have works with the 9i client but not the 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. I am making sure that I am passing in the variable using setInt (it's a number that I'm using). 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. Does this make a difference? The query still runs in TOAD and SQL Navigator...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我的脑海中浮现出两个想法:
另外,根据经验,如果您的数据库很大/很忙,那么在 10g 环境稳定之前您还有很长的路要走。我的建议:
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. My recommendations:
问题出在准备好的语句上的以下方法调用:
删除了它,现在它工作正常。不认为这与 oracle 10g 驱动程序兼容。感谢大家的帮助。
The problem was with the following method call on the prepared statement:
Removed that and now it works fine. Don't think that was compatable with oracle 10g driver. Thanks everyone for the help.