This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

IBM DB/2 9.7 ignoring bad SQL in prepareStatement()?  RSS feed

Xolani Nkosi
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm currently converting an app that we'd developed using Oracle onto DB/2, and noticed something very strange related to the above bit of code. For some reason, the DB/2 driver ignored the incorrect (Oracle specific) SQL in my prepared statement, and went on to attempt to execute the query, which then threw this error: DSRA9110E: Statement is closed.

So my question is, why does the DB/2 driver not throw SQLException when you attempt to prepare completely wrong SQL? In the above example, the sys.dual table doesn't exist - if I try this via a SQL worksheet I get:

------------------------------ Commands Entered ------------------------------
select seq_uw_dictionary.nextval from sys.dual;
select seq_uw_dictionary.nextval from sys.dual
SQL0204N "SYS.DUAL" is an undefined name. SQLSTATE=42704

SQL0204N "SYS.DUAL " is an undefined name.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!