db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Bateman <r...@windofkeltia.com>
Subject So, Derby works...
Date Wed, 08 Jul 2020 17:37:21 GMT
...again, don't know what I changed.* I'm only depending on 
/derby-10.15.2.0.jar/.

What I think is going on is an artifact of being side-by-side with 
another JDBC driver implementation.

I was hoping to keep the original mocked test driver working alongside 
the Derby implementation at least until I'm able to abolish it in every 
case. Just as used to be the case, it's registered thus:

     DriverManager.registerDriver( new MockDriver() );

However, this is not how it works for Derby. It just happens on the 
basis of having the JAR linked (in /pom.xml/). The problem comes that, 
because the MockDriveris explicitly registered, when we go to create a 
Derby connection:

     java.sql.Connection connection = DriverManager.getConnection( 
"jdbc:derby:memory:sampledb;create=true" );

...DriverManagertakes as license to create an instance of the old test 
mock because that is the (only) driver in its registeredDriverslist. *I 
moved the Derby-based code out of the same Java package to solve this?

Thanks again. I'm sorry for having made this annoying.

Russ



Mime
View raw message