Thanks Mike

Do I setup the BasicDataSource in the module I pass to ServerRuntime ?

I've got:

           String  iniFile = .....;
           MyDataSourceModule  module = new MyDataSourceModule(iniFile);
            server = new ServerRuntime( "cayenne-Vision.xml", module );

Do I then in MyDataSourceModule do something like:

@Override
public void configure( Binder binder )
{
     BasicDataSource ds = new BasicDataSource();
     ds.setUsername("scott");
     ds.setPassword("tiger");

     // .... set other options etc.

     binder.bind( BasicDataSource.class ).toInstance( ds );
}

So the question is if I manually configure a DBCP Data Source how do I pass then pass on to Cayenne ?

Thanks, regards
Jurgen




-----Original Message----- From: Mike Kienenberger
Sent: Wednesday, March 12, 2014 5:02 PM
To: [email protected]
Subject: Re: DBCPDataSourceFactory

According to this

http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/doc/BasicDataSourceExample.java?view=markup

BasicDataSource ds = new BasicDataSource();
ds.setUsername("scott");
ds.setPassword("tiger");



On Wed, Mar 12, 2014 at 5:01 AM,  <[email protected]> wrote:
Hi All

I've successfully configured and used DBCP as a Data Source Factory  :-)

Does anybody know how to provide the username and password besides through
the properties file ?

Thanks,
Jurgen


Reply via email to