[ 
https://issues.apache.org/jira/browse/DERBY-2582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491131
 ] 

Daniel John Debrunner commented on DERBY-2582:
----------------------------------------------

I see the issue but I'm not sure of a solution. I think compliance is the key 
point here though, as EmbeddedConnectionPoolDataSource does not claim to be 
JDBC 4.0 compliant in a JDK 6 environment. So once compliance is not there, any 
requirement to implement java.sql.Wrapper goes away.

Of course I think the only compliance indicator in JDBC is on Driver and 
Derby's driver is JDBC 4.0 compliant, but it doesn't really have a direct 
relationship to DataSource objects.

Maybe the meta-data call could return 3 for getJDBCMajorVersion() but then 
connection objects within the same JVM would be returning different values.
I.e. Connection objects created by old data source implementations would return 
3 while those created by DriverManager or the 40 data source implementations 
would return 4. Even though it's the same implementation of Connection in all 
cases, i.e. all Connection objects in a JDK 6 environment are JDBC 4.0 
compliant. This would be additional code for the only reason of satisfying this 
condition, which is assuming compliance for something that isn't. :-)

Another question is what is the Wrapper interface being used for? The Wrapper 
interface is explicitly for non-standard features provided by the JDBC driver 
and since Derby does not provide any non-standard features there should be no 
need to treat any of its JDBC objects as Wrappers.

> EmbeddedConnectionPoolDataSource does not implement java.sql.Wrapper but 
> reports JDBC 4 compliance when run with JDK 6 
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2582
>                 URL: https://issues.apache.org/jira/browse/DERBY-2582
>             Project: Derby
>          Issue Type: Sub-task
>          Components: JDBC
>    Affects Versions: 10.2.2.1
>         Environment: JDK 6
>            Reporter: Stan Bradbury
>
> Software that checks the value returned by the dataseMetadata method 
> getJDBCMajorVersion for JDBC compliance level and, based on the value, takes 
> different paths in the code will fail unexpectedly accessing java.sql.Wrapper 
> when loading EmbeddedConnectionPoolDataSource in a JDK 6 environment.  
> EmbeddedConnectionPoolDataSource reports a compliance level of 4 when loaded 
> in a JDK 6 environment.  It returns JDBC 4 objects but the Datasource itself 
> does NOT satify  the JDBC 4.0 interface Wrapper and so, not being fully 
> compliant, should not report JDBC 4 compliance.  
> JSR 221 does not detail the behavior of the dataseMetadata method 
> getJDBCMajorVersion but the description in Section 6.3, JDBC 4.0 API 
> Compliance, states: "A driver that is compliant with the JDBC 4.0 
> specification must .. Fully implement .. java.sql.Wrapper".  As Dan stated in 
> his comment on DERBY-2488,  
> (http://issues.apache.org/jira/browse/DERBY-2488#action_12485033) 
> EmbeddedConnectionPoolDataSource does not implement Wrapper. 

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

Reply via email to