... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)


JDBC Statement Types

The JDBC API says that CallableStatement extends PreparedStatement that extends Statement.  This suggests that CallableStatement can do everything that PreparedStatement can do, and more (just as PreparedStatement has a superset of Statement functionality).  Well, O-O principles suggest this (viz "extends"), but the documentation leaves room for doubt.  It says that CallableStatement is intended for use to call stored procedures.  Of course it is, except that the wording suggests that that is all it should be used for.  So I wrote a quick program that used the ODBC bridge to see whether I could run a simple query through a CallableStatement.  It worked, and I thought my paranoia unjustified.  Until I tried the same thing with the jTDS driver.  It didn't work, complaining about a syntax error at the keyword SELECT.

Blog Archive