You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by mommymutya <gc...@yahoo.com> on 2012/10/25 07:14:06 UTC

How to override/set custom resource factory in tomee.xml 'Resource'

I would like to do this tomcat setting in my tomee server.
<Resource
	    name="jdbc/myDataSource"
	    auth="Container"
	    type="javax.sql.DataSource"
	    username="user"
	    password="encryptedpassword"
	    driverClassName="driverClass"
	    factory="mypackage.MyCustomBasicDataSourceFactory"
	    url="jdbc:blabla://..."/>

Basically I just would like to have my password encrypted/decrypted.  I used
PasswordCipher but apparently it is only commons-dbcp that recognizes it.  I
would like to use the default tomcat-jdbc for the pool lib so I thought of
just creating my custom class.

At the moment, I have this:
<Resource id="CAWebServiceJTADS" type="DataSource">
		JdbcDriver driver
		JdbcUrl jdbc:blabla:/
		UserName username
		Password encryptedPassword
		JtaManaged true
		ValidationQuery SELECT 1
	</Resource>

I have extended org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory as
MyCustomBasicDataSourceFactory and would like openejb to use it as I have
put the password decryption in an overriden getObjectInstance method.  How
do I set it up for tomee?





--
View this message in context: http://openejb.979440.n4.nabble.com/How-to-override-set-custom-resource-factory-in-tomee-xml-Resource-tp4658258.html
Sent from the OpenEJB User mailing list archive at Nabble.com.