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 "Kathey Marsden (JIRA)" <ji...@apache.org> on 2007/03/14 20:50:09 UTC
[jira] Created: (DERBY-2453) client and embedded differ for return
value for PreparedStatement.getMetaData if there is no ResultSet returned
client and embedded differ for return value for PreparedStatement.getMetaData if there is no ResultSet returned
---------------------------------------------------------------------------------------------------------------
Key: DERBY-2453
URL: https://issues.apache.org/jira/browse/DERBY-2453
Project: Derby
Issue Type: Task
Reporter: Kathey Marsden
Embedded will return a null value for PreparedStatement.getMetaData() if no ResultSet is returned. Client will return a ResultSetMetaData object with 0 columnCount. Looking at the javadoc for getMetaData() it says it returns
"the description of a ResultSet object's columns or null if the driver cannot return a ResultSetMetaData object"
So I am not sure which is the preferable behavior, but it should be the same.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-2453) client and embedded differ for return
value for PreparedStatement.getMetaData if there is no ResultSet returned
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Knut Anders Hatlen updated DERBY-2453:
--------------------------------------
Bug behavior facts: [Embedded/Client difference]
> client and embedded differ for return value for PreparedStatement.getMetaData if there is no ResultSet returned
> ---------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-2453
> URL: https://issues.apache.org/jira/browse/DERBY-2453
> Project: Derby
> Issue Type: Task
> Components: JDBC
> Affects Versions: 10.3.1.4
> Reporter: Kathey Marsden
>
> Embedded will return a null value for PreparedStatement.getMetaData() if no ResultSet is returned. Client will return a ResultSetMetaData object with 0 columnCount. Looking at the javadoc for getMetaData() it says it returns
> "the description of a ResultSet object's columns or null if the driver cannot return a ResultSetMetaData object"
> So I am not sure which is the preferable behavior, but it should be the same.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (DERBY-2453) client and embedded
differ for return value for PreparedStatement.getMetaData if there is no
ResultSet returned
Posted by "Thomas Nielsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504669 ]
Thomas Nielsen edited comment on DERBY-2453 at 6/14/07 4:56 AM:
----------------------------------------------------------------
Agreed, they should behave identical.
Reading the JDBC 4.0 spec, and "JDBC API tutorial and reference, Third edt." [Fisher, Ellis, Bruce], my interpretation is that PerparedStatement.getMetaData should return:
a) null if driver cannot supply the information (for whatever reason)
b) a ResultSetMetaData object once the PreparedStatement has been precompiled. Note that this differs from Statement which needs to perform the execution step to get the ResultSetMetaData object. PreparedStatement is precompiled, so we should be able to retrieve the ResultSet column information before execution.
c) a ResultSetMetaData object once the PreparedStatement has been executed.
The ResultSetMetaData object should be empty (but not null) only if the ResultSet is indeed empty.
If my interpretation is correct, embedded driver does nothing wrong in returning null (it's simply saying I can't supply the information) although it should really be able to return a non-empty ResultSetMetaData object once the PreparedStatement has been precompiled?
The client driver should also be able to return a ResultSetMetaData once the PreparedStatement has been precompiled?
But then again it will not do any wrong by returning null.
was:
Agreed, they should behave identical.
Reading the JDBC 4.0 spec, and "JDBC API tutorial and reference, Third edt." [Fisher, Ellis, Bruce], my interpretation is that PerparedStatement.getMetaData should return:
a) null if driver cannot supply the information (for whatever reason)
b) a ResultSetMetaData object once the PreparedStatement has been precompiled. Note that this differs from Statement which needs to perform the execution step to get the ResultSetMetaData object. PreparedStatement is precompiled, so we should be able to retrieve the ResultSet column information before execution.
c) a ResultSetMetaData object once the PreparedStatement has been executed.
The ResultSetMetaData object should have zero colums only if the ResultSet is indeed empty.
If my interpretation is correct, embedded driver does nothing wrong in returning null (it's simply saying I can't supply the information) although it should really be able to return a non-empty ResultSetMetaData object once the PreparedStatement has been precompiled?
The client driver should also be able to return a ResultSetMetaData once the PreparedStatement has been precompiled?
But then again it will not do any wrong by returning null.
> client and embedded differ for return value for PreparedStatement.getMetaData if there is no ResultSet returned
> ---------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-2453
> URL: https://issues.apache.org/jira/browse/DERBY-2453
> Project: Derby
> Issue Type: Task
> Components: JDBC, Newcomer
> Affects Versions: 10.3.0.0
> Reporter: Kathey Marsden
>
> Embedded will return a null value for PreparedStatement.getMetaData() if no ResultSet is returned. Client will return a ResultSetMetaData object with 0 columnCount. Looking at the javadoc for getMetaData() it says it returns
> "the description of a ResultSet object's columns or null if the driver cannot return a ResultSetMetaData object"
> So I am not sure which is the preferable behavior, but it should be the same.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-2453) client and embedded differ for
return value for PreparedStatement.getMetaData if there is no ResultSet
returned
Posted by "Thomas Nielsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504669 ]
Thomas Nielsen commented on DERBY-2453:
---------------------------------------
Agreed, they should behave identical.
Reading the JDBC 4.0 spec, and "JDBC API tutorial and reference, Third edt." [Fisher, Ellis, Bruce], my interpretation is that PerparedStatement.getMetaData should return:
a) null if driver cannot supply the information (for whatever reason)
b) a ResultSetMetaData object once the PreparedStatement has been precompiled. Note that this differs from Statement which needs to perform the execution step to get the ResultSetMetaData object. PreparedStatement is precompiled, so we should be able to retrieve the ResultSet column information before execution.
c) a ResultSetMetaData object once the PreparedStatement has been executed.
The ResultSetMetaData object should have zero colums only if the ResultSet is indeed empty.
If my interpretation is correct, embedded driver does nothing wrong in returning null (it's simply saying I can't supply the information) although it should really be able to return a non-empty ResultSetMetaData object once the PreparedStatement has been precompiled?
The client driver should also be able to return a ResultSetMetaData once the PreparedStatement has been precompiled?
But then again it will not do any wrong by returning null.
> client and embedded differ for return value for PreparedStatement.getMetaData if there is no ResultSet returned
> ---------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-2453
> URL: https://issues.apache.org/jira/browse/DERBY-2453
> Project: Derby
> Issue Type: Task
> Components: JDBC, Newcomer
> Affects Versions: 10.3.0.0
> Reporter: Kathey Marsden
>
> Embedded will return a null value for PreparedStatement.getMetaData() if no ResultSet is returned. Client will return a ResultSetMetaData object with 0 columnCount. Looking at the javadoc for getMetaData() it says it returns
> "the description of a ResultSet object's columns or null if the driver cannot return a ResultSetMetaData object"
> So I am not sure which is the preferable behavior, but it should be the same.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
Re: [jira] Commented: (DERBY-2453) client and embedded differ for
return value for PreparedStatement.getMetaData if there is no ResultSet
returned
Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
"Kathey Marsden (JIRA)" <ji...@apache.org> writes:
> [ https://issues.apache.org/jira/browse/DERBY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12480943 ]
>
> Kathey Marsden commented on DERBY-2453:
> ---------------------------------------
>
> Actually client is not consistent on this for the statement call
> testproc()
> where testproc does not return a ResultSet , getMetaData returns a
> null ResultSetMetaData object. So my vote is to match embedded and
> always return a null ResultSetMetaData object if there is no
> ResultSet.
+1
Dag
[jira] Commented: (DERBY-2453) client and embedded differ for
return value for PreparedStatement.getMetaData if there is no ResultSet
returned
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12480943 ]
Kathey Marsden commented on DERBY-2453:
---------------------------------------
Actually client is not consistent on this for the statement
call testproc()
where testproc does not return a ResultSet , getMetaData returns a null ResultSetMetaData object. So my vote is to match embedded and always return a null ResultSetMetaData object if there is no ResultSet.
> client and embedded differ for return value for PreparedStatement.getMetaData if there is no ResultSet returned
> ---------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-2453
> URL: https://issues.apache.org/jira/browse/DERBY-2453
> Project: Derby
> Issue Type: Task
> Components: JDBC, Newcomer
> Affects Versions: 10.3.0.0
> Reporter: Kathey Marsden
>
> Embedded will return a null value for PreparedStatement.getMetaData() if no ResultSet is returned. Client will return a ResultSetMetaData object with 0 columnCount. Looking at the javadoc for getMetaData() it says it returns
> "the description of a ResultSet object's columns or null if the driver cannot return a ResultSetMetaData object"
> So I am not sure which is the preferable behavior, but it should be the same.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-2453) client and embedded differ for return
value for PreparedStatement.getMetaData if there is no ResultSet returned
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kathey Marsden updated DERBY-2453:
----------------------------------
Component/s: Newcomer
JDBC
Affects Version/s: 10.3.0.0
> client and embedded differ for return value for PreparedStatement.getMetaData if there is no ResultSet returned
> ---------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-2453
> URL: https://issues.apache.org/jira/browse/DERBY-2453
> Project: Derby
> Issue Type: Task
> Components: JDBC, Newcomer
> Affects Versions: 10.3.0.0
> Reporter: Kathey Marsden
>
> Embedded will return a null value for PreparedStatement.getMetaData() if no ResultSet is returned. Client will return a ResultSetMetaData object with 0 columnCount. Looking at the javadoc for getMetaData() it says it returns
> "the description of a ResultSet object's columns or null if the driver cannot return a ResultSetMetaData object"
> So I am not sure which is the preferable behavior, but it should be the same.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.