Re: DBCPDataSourceFactory

2014-03-12 Thread dollj
I agree Andrus, however I'm not comfortable with having a username & password in a properties file unless encrypted. Now the XMLPoolingDataSourceFactory in the Modeler caters for a password encoder, which is great. However the database I'm using has a default transaction isolation level of REA

Re: DBCPDataSourceFactory

2014-03-12 Thread Andrus Adamchik
On Mar 12, 2014, at 8:50 PM, do...@xsinet.co.za wrote: > Yip, that's what I was using in the Modeler but the username and pass have to > be in a properties file and I was hoping that there was a simple alternative. Usually the problem with specifying password (and other settings) in the Modele

Re: DBCPDataSourceFactory

2014-03-12 Thread dollj
Yip, that's what I was using in the Modeler but the username and pass have to be in a properties file and I was hoping that there was a simple alternative. Anyway I've downloaded the Cayenne source and will extend either DBCPDataSourceFactory or XMLPoolingDataSourceFactory. Thanks again, r

Re: DBCPDataSourceFactory

2014-03-12 Thread Mike Kienenberger
There should already be a org.apache.cayenne.configuration.server.DBCPDataSourceFactory http://cayenne.apache.org/docs/3.0/dbcpdatasourcefactory.html that will either do what you want, or serve as an example for how to create your own customized version of it. I needed a file-based data source

Re: DBCPDataSourceFactory

2014-03-12 Thread dollj
Thanks again Mike I don't manually configure or bind the DataSourceFactory to the serverRuntime, but instead allow it to pull it in from the cayenne.xml file. Ok, you mentioned this before and I see in the Modeler where this can be specified. I take it then that MyDataSourceFactory just nee

Re: DBCPDataSourceFactory

2014-03-12 Thread Mike Kienenberger
I'm not an expert on this, but I'd set those values when I created the Data Source. For my DataSourceFactory, this happens in getDataSource(). I don't manually configure or bind the DataSourceFactory to the serverRuntime, but instead allow it to pull it in from the cayenne.xml file. public

Re: DBCPDataSourceFactory

2014-03-12 Thread dollj
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 MyDataS

Re: DBCPDataSourceFactory

2014-03-12 Thread Mike Kienenberger
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, wrote: > Hi All > > I've successfully configured

DBCPDataSourceFactory

2014-03-12 Thread dollj
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