Issue Details (XML | Word | Printable)

Key: JDBC-288
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: Mark Rotteveel
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Jaybird JCA/JDBC Driver

FBPreparedStatement and FBCallableStatement not compliant for java.sql.Statement methods

Created: 07/Dec/12 05:57 PM   Updated: 21/Feb/13 08:08 PM
Component/s: JDBC driver
Affects Version/s: Jaybird 2.1.6, Jaybird 2.2, Jaybird 2.2.1
Fix Version/s: Jaybird 2.2.2, Jaybird 3.0.0

Sub-Tasks  All   Open   

 Description  « Hide
The current implementation of FBPreparedStatement and FBCallableStatement are not compliant with the JDBC specification as they allow use of methods defined on java.sql.Statement that are explicitly marked with "Note:This method cannot be called on a PreparedStatement or CallableStatement." in the Javadoc (this was added with JDBC 4.0). These are mostly the methods that accept a string with a query.

These methods should be modified to throw an SQLException in FBPreparedStatement and/or FBCallableStatement. It would probably also be a good idea to review the current class hierarchy and see if it is actually sensible that FBPreparedStatement extends FBStatement and that FBCallableStatement extends FBPreparedStatement.

Example of problem:

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 07/Dec/12 06:29 PM
Scheduling for Jaybird 2.3, need to think if it also needs to be backported to 2.2.2; essentially this has always been broken.

Mark Rotteveel added a comment - 07/Dec/12 07:58 PM
Committed short-term fix and additional tests. I will review class-hierarchy at a later date.

Mark Rotteveel added a comment - 08/Dec/12 02:26 PM
Decided to also backport the basic fix to 2.2.2

Mark Rotteveel added a comment - 08/Dec/12 02:32 PM
Created subtask for review/refactor. Closing this ticket as fixed.