db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <derby-...@db.apache.org>
Subject [jira] Updated: (DERBY-501) Client and embedded drivers differ on invoking a procedure that returns a single Dynamic resultSet using CallableStatement.executeQuery()
Date Thu, 08 Jun 2006 13:00:32 GMT
     [ http://issues.apache.org/jira/browse/DERBY-501?page=all ]

Knut Anders Hatlen updated DERBY-501:

    Derby Info: [Patch Available, Existing Application Impact, Release Note Needed]  (was:
[Patch Available])

I don't think it is very likely that existing applications are
affected, but they *might* be. To be on the safe side, we could add a
line to the release notes saying:

  The behaviour of executeQuery() and executeUpdate() has been
  modified to follow the JDBC standard when executing stored
  procedures. It is now possible to use executeQuery() to execute a
  stored procedure that returns exactly one ResultSet (this would fail
  in previous releases of Derby). executeUpdate() will raise an
  exception if it is used to execute a stored procedure that returns
  one or more ResultSets (this would succeed in previous releases of

Note that this only applies to the embedded driver. There will be some
changes to the client driver in DERBY-1314, but not the same
changes. When writing the release notes, it is probably best to write
one note describing both DERBY-501 and DERBY-1314.

> Client and embedded drivers differ on invoking a procedure that returns a single Dynamic
resultSet using CallableStatement.executeQuery()
> -----------------------------------------------------------------------------------------------------------------------------------------
>          Key: DERBY-501
>          URL: http://issues.apache.org/jira/browse/DERBY-501
>      Project: Derby
>         Type: Bug

>   Components: JDBC
>     Versions:,
>  Environment: All Platforms
>     Reporter: Satheesh Bandaram
>     Assignee: Knut Anders Hatlen
>  Attachments: Test.java, Test1.java, derby-501-v1.diff, derby-501-v1.stat, derby-501-v2.diff,
derby-501-v2.stat, derby-501-v3.diff, derby-501-v3.stat
> It is possible to invoke a stored procedure that returns a single dynamic result using
CallableStatement.executeQuery using Derby Client. The embedded JDBC driver, however, throws
an exception like:
> Test starting ...url = jdbc:derby:tdb
> Exception in thread "main" ERROR X0Y78: Statement.executeQuery() cannot be called with
a statement that returns a row count.
>         at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:301)
>         at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:434)
>         at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1142)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1323)
>         at org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(EmbedCallableStatement.java:109)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(EmbedPreparedStatement.java:241)
>         at Test1.main(Test1.java:26)
> I think the embedded driver behavior is incorrect here, though I would double check that
the JDBC spec says. 
> To reproduce the problem,
> 1) Create a database called 'tdb' and a table called COMPANY as create table COMPANY(name
> 2) Insert two rows as: insert into COMPANY values 'IBM', 'SUN';
> 3) register a procedure as:
> 4) Set server classpath
> 5) Compile two attached java programs, Test and Test1
> 6) Execute 'java Test1 1' to run as a client program and 'java Test1 2' to run as an
embedded program.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message