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 "Mamta A. Satoor (JIRA)" <ji...@apache.org> on 2014/05/15 06:12:20 UTC

[jira] [Commented] (DERBY-6459) Remove Class.forName calls that load JDBC driver from Derby samples/demos

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

Mamta A. Satoor commented on DERBY-6459:
----------------------------------------

I recently ran into following failure while running derbyall suite with classes.
**** Start SubSuite: derbyall:simpledemo jdk1.6.0 2014-05-07 17:21:18 ****
 Framework: No special framework.
*** Start: SimpleApp jdk1.6.0 derbyall:simpledemo 2014-05-07 17:21:18 ***
2 del
< Connected to and created database derbyDB
3 del
< Created table location
4 del
 < Inserted 1956 Webster
5 del
< Inserted 1910 Union
6 del
< Updated 1956 Webster to 180 Grand
7 del
< Updated 180 Grand to 300 Lakeshore
8 del
< Verified the rows
9 del
< Dropped table location
 10 del
< Committed the transaction
11 del
< Derby shut down normally
11a2,5
> ----- SQLException -----
>   SQL State:  08001
>   Error Code: 0
>   Message:    No suitable driver
 Test Failed.
*** End:   SimpleApp jdk1.6.0 derbyall:simpledemo 2014-05-07 17:21:19 ***
**** End SubSuite: derbyall:simpledemo jdk1.6.0 2014-05-07 17:21:19 ****

Knut mentioned that, "Are you by any chance running the tests against classes rather than jars?
 The SimpleApp demo was updated to rely on JDBC driver autoloading in DERBY-6459 after Java 6 was made the minimum level, and the driver is only autoloaded when using jars.

 A workaround was added to allow the test to still run against classes.
 See http://svn.apache.org/r1569662 . Maybe that workaround isn't enough
 in your environment. (Admittedly, I probably didn't run the full
 derbyall test suite against classes to test the fix, only the simpledemo
 suite.)" .

I tried running derbyall with jar files and this time, the test succeeded with just one small diff as shown below. Looks like all we need to do is to update the cannon. I am just wondering though that why has this not failed for others when they run derbyall with jars. Thanks
********* Diff file derbyall/derbynetclientmats/DerbyNetClient/encodingTests/TestEnc.diff
*** Start: TestEnc jdk1.6.0 DerbyNetClient derbynetclientmats:encodingTests 2014-05-14 19:40:13 ***
derbyTesting.encoding can only be used with jdk15, skipping test
*** End:   TestEnc jdk1.6.0 DerbyNetClient derbynetclientmats:encodingTests 2014-05-14 19:40:13 ***
********* Diff file derbyall/simpledemo/SimpleApp.diff
*** Start: SimpleApp jdk1.6.0 derbyall:simpledemo 2014-05-14 19:43:40 ***
1a2
> connection is jdbc:derby:derbyDB;create=true{user=user1, password=user1}
Test Failed.
*** End:   SimpleApp jdk1.6.0 derbyall:simpledemo 2014-05-14 19:43:45 ***


> Remove Class.forName calls that load JDBC driver from Derby samples/demos
> -------------------------------------------------------------------------
>
>                 Key: DERBY-6459
>                 URL: https://issues.apache.org/jira/browse/DERBY-6459
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Demos/Scripts
>    Affects Versions: 10.11.0.0
>            Reporter: Kim Haase
>            Assignee: Kim Haase
>             Fix For: 10.11.0.0
>
>         Attachments: DERBY-6459-2.diff, DERBY-6459-3.diff, DERBY-6459.diff, DERBY-6459.stat
>
>
> Several of the Derby samples and demos call Class.forName to load the JDBC driver, although this is not necessary at Java SE 6 and later. Since at 10.11 we won't support versions of the platform earlier than JDK 6, these calls should be removed from the samples (and any mention of them removed from the accompanying documentation).
> There are calls to Class.forName that load other objects besides the driver; I assume these are still needed, but if not, they could be replaced with something more current.



--
This message was sent by Atlassian JIRA
(v6.2#6252)