db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3676) Make the toString() method of Derby PreparedStatements print out SQL text with ? parameters replaced by the values that have been set so far
Date Tue, 20 May 2008 15:06:55 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12598319#action_12598319
] 

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

Since this particular behaviour of EmbedPreparedStatement.toString()
is undocumented and not part of our published API, I would hope that
there aren't too many applications that depend on it. Perhaps it would
make more sense to change it to return more useful information and
warn the users in a release note, and provide a non-standard but
documented way to get the old information through our published
API. For instance, we could use Rick's idea with a static method in
EmbeddedDriver and call it getSQLText(PreparedStatement).

For the record, the client driver doesn't implement
PreparedStatement.toString() and only returns
org.apache.derby.client.am.PreparedStatement40@1e3118a.

> Make the toString() method of Derby PreparedStatements print out SQL text with ? parameters
replaced by the values that have been set so far
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3676
>                 URL: https://issues.apache.org/jira/browse/DERBY-3676
>             Project: Derby
>          Issue Type: New Feature
>          Components: JDBC, Newcomer
>            Reporter: Rick Hillegas
>         Attachments: ick.txt, ick.txt
>
>
> This topic came up in the following email thread on the user list: http://www.nabble.com/PreparedStatement.toString%28%29---nice-formatting-td17250811.html#a17250811
Here's what the thread requests: 
> "In mysql, a toString() on a PreparedStatement will do this, eg "select x
> from foo where x.a = ?" will become "select x from foo where x.a = 1" with
> the appropriate setValue() call."
> At first blush, this seems like it might be a simple project for a newcomer.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message