You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Rick Hillegas (JIRA)" <de...@db.apache.org> on 2006/02/10 22:44:56 UTC

[jira] Created: (DERBY-947) Miscellaneous PreparedStatement methods added by JDBC4

Miscellaneous PreparedStatement methods added by JDBC4
------------------------------------------------------

         Key: DERBY-947
         URL: http://issues.apache.org/jira/browse/DERBY-947
     Project: Derby
        Type: New Feature
  Components: JDBC  
    Reporter: Rick Hillegas
     Fix For: 10.2.0.0


As described in the JDBC 4 spec sections 13.2 and 3.1.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Resolved: (DERBY-947) Miscellaneous PreparedStatement methods added by JDBC4

Posted by Francois Orsini <fr...@gmail.com>.
Thanks for committing this patch Knut! - I have not noticed the error
either when I ran derbyall manually.

On 3/10/06, Knut Anders Hatlen (JIRA) <de...@db.apache.org> wrote:
>      [ http://issues.apache.org/jira/browse/DERBY-947?page=all ]
>
> Knut Anders Hatlen resolved DERBY-947:
> --------------------------------------
>
>     Resolution: Fixed
>
> Patch looks good!
>
> I got one failure in derbyall. lang/closed.java produced a diff, but
> it seemed totally unrelated to the patch. A line containing
>
>   ERROR 08006: Database 'wombat' shutdown.
>
> was printed earlier than expected. Probably a timing issue. At least,
> it wasn't there when I re-ran the test manually.
>
> The jdbc4 suite ran successfully (Sun JVM 1.6.0-beta2-b74).
>
> Committed revision 384753.
>
> > Miscellaneous PreparedStatement methods added by JDBC4
> > ------------------------------------------------------
> >
> >          Key: DERBY-947
> >          URL: http://issues.apache.org/jira/browse/DERBY-947
> >      Project: Derby
> >         Type: New Feature
> >   Components: JDBC
> >     Reporter: Rick Hillegas
> >     Assignee: Francois Orsini
> >      Fix For: 10.2.0.0
> >  Attachments: DERBY-947-v1.diff, DERBY-947-v1.stat, DERBY-947-v2.diff, DERBY-947-v2.stat
> >
> > As described in the JDBC 4 spec sections 13.2 and 3.1.
> > This involves building support for JDBC4 methods added to PreparedStatement and not addressed by other JIRAs: isPoolable() and setPoolable().
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
>    http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>    http://www.atlassian.com/software/jira
>
>

[jira] Assigned: (DERBY-947) Miscellaneous PreparedStatement methods added by JDBC4

Posted by "Francois Orsini (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-947?page=all ]

Francois Orsini reassigned DERBY-947:
-------------------------------------

    Assign To: Francois Orsini

> Miscellaneous PreparedStatement methods added by JDBC4
> ------------------------------------------------------
>
>          Key: DERBY-947
>          URL: http://issues.apache.org/jira/browse/DERBY-947
>      Project: Derby
>         Type: New Feature
>   Components: JDBC
>     Reporter: Rick Hillegas
>     Assignee: Francois Orsini
>      Fix For: 10.2.0.0

>
> As described in the JDBC 4 spec sections 13.2 and 3.1.
> This involves building support for JDBC4 methods added to PreparedStatement and not addressed by other JIRAs: isPoolable() and setPoolable().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-947) Miscellaneous PreparedStatement methods added by JDBC4

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-947?page=comments#action_12369454 ] 

Knut Anders Hatlen commented on DERBY-947:
------------------------------------------

Hi Francois,

Your code changes look very good, but I have one comment to the test
code:

+            if (SQLState.ALREADY_CLOSED.equals(sqle.getSQLState()) ||
+                stmtIsClosed) {
+                // All is good and is expected

SQLState.ALREADY_CLOSED is "XJ012.S". However, it seems like
sqle.getSQLState() will return "XJ012". (EmbedSQLException invokes
StandardException.getSQLStateFromIdentifier, which performs
substring(0, 5) on the SQL state identifier.)

Would it make sense to replace SQLState.ALREADY_CLOSED with "XJ012"?
Alternatively, you could define a local constant

    final String ALREADY_CLOSED =
        SQLState.ALREADY_CLOSED.substring(0, 5); // ugh!

> Miscellaneous PreparedStatement methods added by JDBC4
> ------------------------------------------------------
>
>          Key: DERBY-947
>          URL: http://issues.apache.org/jira/browse/DERBY-947
>      Project: Derby
>         Type: New Feature
>   Components: JDBC
>     Reporter: Rick Hillegas
>     Assignee: Francois Orsini
>      Fix For: 10.2.0.0
>  Attachments: DERBY-947-v1.diff, DERBY-947-v1.stat
>
> As described in the JDBC 4 spec sections 13.2 and 3.1.
> This involves building support for JDBC4 methods added to PreparedStatement and not addressed by other JIRAs: isPoolable() and setPoolable().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DERBY-947) Miscellaneous PreparedStatement methods added by JDBC4

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-947?page=all ]
     
Rick Hillegas closed DERBY-947:
-------------------------------


> Miscellaneous PreparedStatement methods added by JDBC4
> ------------------------------------------------------
>
>          Key: DERBY-947
>          URL: http://issues.apache.org/jira/browse/DERBY-947
>      Project: Derby
>         Type: New Feature

>   Components: JDBC
>     Reporter: Rick Hillegas
>     Assignee: Francois Orsini
>      Fix For: 10.2.0.0
>  Attachments: DERBY-947-v1.diff, DERBY-947-v1.stat, DERBY-947-v2.diff, DERBY-947-v2.stat
>
> As described in the JDBC 4 spec sections 13.2 and 3.1.
> This involves building support for JDBC4 methods added to PreparedStatement and not addressed by other JIRAs: isPoolable() and setPoolable().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-947) Miscellaneous PreparedStatement methods added by JDBC4

Posted by "Francois Orsini (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-947?page=all ]

Francois Orsini updated DERBY-947:
----------------------------------

    Attachment: DERBY-947-v2.diff

> Miscellaneous PreparedStatement methods added by JDBC4
> ------------------------------------------------------
>
>          Key: DERBY-947
>          URL: http://issues.apache.org/jira/browse/DERBY-947
>      Project: Derby
>         Type: New Feature
>   Components: JDBC
>     Reporter: Rick Hillegas
>     Assignee: Francois Orsini
>      Fix For: 10.2.0.0
>  Attachments: DERBY-947-v1.diff, DERBY-947-v1.stat, DERBY-947-v2.diff, DERBY-947-v2.stat
>
> As described in the JDBC 4 spec sections 13.2 and 3.1.
> This involves building support for JDBC4 methods added to PreparedStatement and not addressed by other JIRAs: isPoolable() and setPoolable().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (DERBY-947) Miscellaneous PreparedStatement methods added by JDBC4

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-947?page=all ]
     
Knut Anders Hatlen resolved DERBY-947:
--------------------------------------

    Resolution: Fixed

Patch looks good!

I got one failure in derbyall. lang/closed.java produced a diff, but
it seemed totally unrelated to the patch. A line containing

  ERROR 08006: Database 'wombat' shutdown.

was printed earlier than expected. Probably a timing issue. At least,
it wasn't there when I re-ran the test manually.

The jdbc4 suite ran successfully (Sun JVM 1.6.0-beta2-b74).

Committed revision 384753.

> Miscellaneous PreparedStatement methods added by JDBC4
> ------------------------------------------------------
>
>          Key: DERBY-947
>          URL: http://issues.apache.org/jira/browse/DERBY-947
>      Project: Derby
>         Type: New Feature
>   Components: JDBC
>     Reporter: Rick Hillegas
>     Assignee: Francois Orsini
>      Fix For: 10.2.0.0
>  Attachments: DERBY-947-v1.diff, DERBY-947-v1.stat, DERBY-947-v2.diff, DERBY-947-v2.stat
>
> As described in the JDBC 4 spec sections 13.2 and 3.1.
> This involves building support for JDBC4 methods added to PreparedStatement and not addressed by other JIRAs: isPoolable() and setPoolable().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-947) Miscellaneous PreparedStatement methods added by JDBC4

Posted by "Francois Orsini (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-947?page=all ]

Francois Orsini updated DERBY-947:
----------------------------------

    Attachment: DERBY-947-v2.stat

> Miscellaneous PreparedStatement methods added by JDBC4
> ------------------------------------------------------
>
>          Key: DERBY-947
>          URL: http://issues.apache.org/jira/browse/DERBY-947
>      Project: Derby
>         Type: New Feature
>   Components: JDBC
>     Reporter: Rick Hillegas
>     Assignee: Francois Orsini
>      Fix For: 10.2.0.0
>  Attachments: DERBY-947-v1.diff, DERBY-947-v1.stat, DERBY-947-v2.stat
>
> As described in the JDBC 4 spec sections 13.2 and 3.1.
> This involves building support for JDBC4 methods added to PreparedStatement and not addressed by other JIRAs: isPoolable() and setPoolable().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-947) Miscellaneous PreparedStatement methods added by JDBC4

Posted by "Francois Orsini (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-947?page=all ]

Francois Orsini updated DERBY-947:
----------------------------------

    Attachment: DERBY-947-v1.stat

> Miscellaneous PreparedStatement methods added by JDBC4
> ------------------------------------------------------
>
>          Key: DERBY-947
>          URL: http://issues.apache.org/jira/browse/DERBY-947
>      Project: Derby
>         Type: New Feature
>   Components: JDBC
>     Reporter: Rick Hillegas
>     Assignee: Francois Orsini
>      Fix For: 10.2.0.0
>  Attachments: DERBY-947-v1.diff, DERBY-947-v1.stat
>
> As described in the JDBC 4 spec sections 13.2 and 3.1.
> This involves building support for JDBC4 methods added to PreparedStatement and not addressed by other JIRAs: isPoolable() and setPoolable().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-947) Miscellaneous PreparedStatement methods added by JDBC4

Posted by "Francois Orsini (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-947?page=comments#action_12369787 ] 

Francois Orsini commented on DERBY-947:
---------------------------------------

to follow-up on above comments - new changes have been posted as DERBY-947-v2.stat and DERBY-947-v2.diff.

> Miscellaneous PreparedStatement methods added by JDBC4
> ------------------------------------------------------
>
>          Key: DERBY-947
>          URL: http://issues.apache.org/jira/browse/DERBY-947
>      Project: Derby
>         Type: New Feature
>   Components: JDBC
>     Reporter: Rick Hillegas
>     Assignee: Francois Orsini
>      Fix For: 10.2.0.0
>  Attachments: DERBY-947-v1.diff, DERBY-947-v1.stat, DERBY-947-v2.diff, DERBY-947-v2.stat
>
> As described in the JDBC 4 spec sections 13.2 and 3.1.
> This involves building support for JDBC4 methods added to PreparedStatement and not addressed by other JIRAs: isPoolable() and setPoolable().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-947) Miscellaneous PreparedStatement methods added by JDBC4

Posted by "Francois Orsini (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-947?page=comments#action_12369786 ] 

Francois Orsini commented on DERBY-947:
---------------------------------------

Knut, thanks for the review.

Good catch - I actually followed some logic which is there all accross the JDBC 4 tests, such as:

        } catch(SQLException e) {
            if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) {
                System.out.println("Unexpected SQLException"+e);
            }        
        }

which is exposing the same issue...Also I believe the equal expression above should be reversed - it is evaluated to false right now everytime in both client and engine modes...I will fill in a separate JIRA for this (it is independent of the scope of the changes for this JIRA).

Interestingly enough, the SQL state on the client driver is not always being set - for instance, logic in
\trunk\java\client\org\apache\derby\client\am\Statement.java

do not set the sql state upon throwing new sql exceptions - hence the following logic below,
...
throw new SqlException(agent_.logWriter_, "Invalid maxFieldSize value: " + max);
... 

will yield to 'null' when retrieving the sql state of a raised exception via SQLException.getSQLState(), hence making it impossible to write a JDBC application which relies on sql state for the client/server mode - we don't have this problem with the embedded driver...This is already reported as part of JIRA-254 which is supposed to address this issue as well.

I have changed the code to use a sql exception util method in ExceptionUtil class from the shared package to extract the 5 chars sql state out of the message identifier (like embedded does and client should do) - interestingly enough the logic to extract the state our of the msg id is duplicated in trunk\java\engine\org\apache\derby\iapi\error\StandardException.java but it is a different problem and not in the scope of this JIRA.

> Miscellaneous PreparedStatement methods added by JDBC4
> ------------------------------------------------------
>
>          Key: DERBY-947
>          URL: http://issues.apache.org/jira/browse/DERBY-947
>      Project: Derby
>         Type: New Feature
>   Components: JDBC
>     Reporter: Rick Hillegas
>     Assignee: Francois Orsini
>      Fix For: 10.2.0.0
>  Attachments: DERBY-947-v1.diff, DERBY-947-v1.stat, DERBY-947-v2.stat
>
> As described in the JDBC 4 spec sections 13.2 and 3.1.
> This involves building support for JDBC4 methods added to PreparedStatement and not addressed by other JIRAs: isPoolable() and setPoolable().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-947) Miscellaneous PreparedStatement methods added by JDBC4

Posted by "Francois Orsini (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-947?page=all ]

Francois Orsini updated DERBY-947:
----------------------------------

    Attachment: DERBY-947-v1.diff

> Miscellaneous PreparedStatement methods added by JDBC4
> ------------------------------------------------------
>
>          Key: DERBY-947
>          URL: http://issues.apache.org/jira/browse/DERBY-947
>      Project: Derby
>         Type: New Feature
>   Components: JDBC
>     Reporter: Rick Hillegas
>     Assignee: Francois Orsini
>      Fix For: 10.2.0.0
>  Attachments: DERBY-947-v1.diff, DERBY-947-v1.stat
>
> As described in the JDBC 4 spec sections 13.2 and 3.1.
> This involves building support for JDBC4 methods added to PreparedStatement and not addressed by other JIRAs: isPoolable() and setPoolable().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-947) Miscellaneous PreparedStatement methods added by JDBC4

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-947?page=all ]

Rick Hillegas updated DERBY-947:
--------------------------------

    Description: 
As described in the JDBC 4 spec sections 13.2 and 3.1.

This involves building support for JDBC4 methods added to PreparedStatement and not addressed by other JIRAs: isPoolable() and setPoolable().

  was:As described in the JDBC 4 spec sections 13.2 and 3.1.


> Miscellaneous PreparedStatement methods added by JDBC4
> ------------------------------------------------------
>
>          Key: DERBY-947
>          URL: http://issues.apache.org/jira/browse/DERBY-947
>      Project: Derby
>         Type: New Feature
>   Components: JDBC
>     Reporter: Rick Hillegas
>      Fix For: 10.2.0.0

>
> As described in the JDBC 4 spec sections 13.2 and 3.1.
> This involves building support for JDBC4 methods added to PreparedStatement and not addressed by other JIRAs: isPoolable() and setPoolable().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-947) Miscellaneous PreparedStatement methods added by JDBC4

Posted by "Francois Orsini (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-947?page=comments#action_12369442 ] 

Francois Orsini commented on DERBY-947:
---------------------------------------

Here are the changes to address JIRA DERBY-947.

Uploaded DERBY-947-v1.diff which implements PreparedStatement.isPoolable() and
PreparedStatement.isPoolable()  on embedded and client sides.

Added some test cases to jdbc4/TestPreparedStatementMethods.java.

There is a FIXME in some of the unit test logic as a reminder  to use Statement.isClosed() instead of a local hint when it is implemented as part of JIRA DERBY-953 - Also, the proper SQL State should be checked against to detect if the exception is due to a statement that has already been closed - right now, the proper SQLState for a statement already closed is only set in embedded - There is already a JIRA to fix SQLState on some of the client side classes.

I have run the jdbc4 suite as well as derbyall on Windows XP / Sun JVM 1.6.0_b72 without errors.

Let me know of your comments. Thanks.

> Miscellaneous PreparedStatement methods added by JDBC4
> ------------------------------------------------------
>
>          Key: DERBY-947
>          URL: http://issues.apache.org/jira/browse/DERBY-947
>      Project: Derby
>         Type: New Feature
>   Components: JDBC
>     Reporter: Rick Hillegas
>     Assignee: Francois Orsini
>      Fix For: 10.2.0.0
>  Attachments: DERBY-947-v1.diff, DERBY-947-v1.stat
>
> As described in the JDBC 4 spec sections 13.2 and 3.1.
> This involves building support for JDBC4 methods added to PreparedStatement and not addressed by other JIRAs: isPoolable() and setPoolable().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira