Re: BasicDataSource creation throws SQLException

2016-08-12 Thread Roy Leonardus
Hi Christopher, I only called the basicdatasource.getconnection() in the main test class. but i added TestDriver.addconnection() beforehand. this is my driver class public class TestDriver implements Driver { public static final String TESTDRIVER_PREFIX = "jdbc:not_a_db:"; static { try { Driv

Re: BasicDataSource creation throws SQLException

2016-08-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Roy, On 8/11/16 3:43 AM, Roy Leonardus wrote: > Hello Christopher, > > maybe i'm a little bit slow here, but from what i see, we should > mock the connection method > > Connection connection= ds.getConnection(); > > something like > > Connection

Re: BasicDataSource creation throws SQLException

2016-08-11 Thread Roy Leonardus
Hello Christopher, maybe i'm a little bit slow here, but from what i see, we should mock the connection method Connection connection= ds.getConnection(); something like Connection connection =(Connection) EasyMock.expect(ds. isvalid()).andReturn(true).anyTimes(); Problem is, th

Re: BasicDataSource creation throws SQLException

2016-08-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Roy, On 8/10/16 11:11 AM, Roy Leonardus wrote: > Hello Christopher, > > Thank you for the tip, i managed to test the code using the apache > Derby now. > > it would be interesting to enhance the driver class to respond with > some result set, but

Re: BasicDataSource creation throws SQLException

2016-08-10 Thread Roy Leonardus
Hello Christopher, Thank you for the tip, i managed to test the code using the apache Derby now. it would be interesting to enhance the driver class to respond with some result set, but i need to review it again. and it will be another homework for me. Roy On Tue, Aug 9, 2016 at 8:54 PM, Chris

Re: BasicDataSource creation throws SQLException

2016-08-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Roy, On 8/3/16 10:03 AM, Roy Leonardus wrote: > i'm using the EasyMock to test the creation of the BasicDataSource > : > > BasicDataSource ds = prepareDataSource(); //set the properties of > the basic data source Connection connection = ds.getConne

Re: BasicDataSource creation throws SQLException

2016-08-03 Thread Roy Leonardus
Hello Mark, i'm using the EasyMock to test the creation of the BasicDataSource : BasicDataSource ds = prepareDataSource(); //set the properties of the basic data source Connection connection = ds.getConnection(); // throw an error here The properties that is set is bds.setMaxTotal(maxT

Re: BasicDataSource creation throws SQLException

2016-08-03 Thread Mark Thomas
On 03/08/2016 01:46, Roy Leonardus wrote: > Dear All, > > I tried to create a new BasicDataSource and encountered such error Let me just see if I can find Pid's crystal ball so I know how you tried to create a new BasicDataSource and the state of the system on which you were trying to do that...

BasicDataSource creation throws SQLException

2016-08-03 Thread Roy Leonardus
Dear All, I tried to create a new BasicDataSource and encountered such error java.sql.SQLException: Cannot create PoolableConnectionFactory (isValid() returned false) this is caused by this method in the PoolableConnection public void