Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FBPreparedStatement and FBCallableStatement not compliant for java.sql.Statement methods [JDBC288] #334

Closed
firebird-issue-importer opened this issue Dec 7, 2012 · 11 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Dec 7, 2012

Submitted by: @mrotteveel

Jira_subtask_outward JDBC289

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: http://stackoverflow.com/q/13754898/466862

Commits: 2152962 07020e1

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 7, 2012

Modified by: @mrotteveel

description: 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. These are mostly the methods that accept a string with a query.

These methods should be modified to throw an SQLException.

=>

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. These are mostly the methods that accept a string with a query.

These methods should be modified to throw an SQLException.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 7, 2012

Modified by: @mrotteveel

description: 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. These are mostly the methods that accept a string with a query.

These methods should be modified to throw an SQLException.

=>

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.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 7, 2012

Modified by: @mrotteveel

description: 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.

=>

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: http://stackoverflow.com/q/13754898/466862

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 7, 2012

Commented by: @mrotteveel

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.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 7, 2012

Modified by: @mrotteveel

Fix Version: Jaybird 2.3 [ 10440 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 7, 2012

Commented by: @mrotteveel

Committed short-term fix and additional tests. I will review class-hierarchy at a later date.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 8, 2012

Commented by: @mrotteveel

Decided to also backport the basic fix to 2.2.2

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 8, 2012

Modified by: @mrotteveel

Fix Version: Jaybird 2.2.2 [ 10480 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 8, 2012

Commented by: @mrotteveel

Created subtask for review/refactor. Closing this ticket as fixed.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 8, 2012

Modified by: @mrotteveel

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 21, 2013

Modified by: @mrotteveel

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment