views:

74

answers:

1

As ColdFusion datasource we are using the Oracle thin client to connect with the database. So, basically we are using a JDBC URL such as jdbc:oracle:thin:@... and as Driver Class oracle.jdbc.OracleDriver

This works successfully however we would like to set encryption and integrity parameters as well. In Java this is done similarly by setting a Properties object prior to getting a connection as follows:

Properties prop = new Properties();
prop.put("oracle.net.encryption_client", "REQUIRED");
prop.put("oracle.net.encryption_types_client", "( DES40 )");
prop.put("oracle.net.crypto_checksum_client", "REQUESTED");
prop.put("oracle.net.crypto_checksum_types_client", "( MD5 )");

...

OracleDataSource ods = new OracleDataSource();
ods.setProperties(prop);
ods.setURL("jdbc:oracle:thin:@localhost:1521:main");
Connection conn = ods.getConnection();

...

Is there a way that I can pass these parameters to the ColdFusion datasource. Ideally, I would love to do this centrally in such way that a change to all the cfquery or cfstoredproc is not needed.

I also know that in application servers such as Oracle AS there is an option when creating a datasource which says "Add Properties". In there you can add such properties. So, I was thinking of maybe creating a JNDI DS in the app. server and then magically connecting to it but this may have some impacts on the app.

Besides this I was also thinking of communicating with the CF datasource through the CF admin API (cfide.adminapi.administrator) and also the option of extending the Oracle driver so that when CF connects with it these params are already set.

I would love to have your professional opinion and suggestions on this.

A: 

All data sources in ColdFusion can be configured with a connection string. I would see if it is possible to pass your properties as part of the connection string.

To change the connection string open the data source in the CF admin and go to 'Advanced Settings'. There is a box there you can fill out.

If you figure that out then the whole process should be transparent those those using the data source.

I hope that helps some.

Ciaran Archer
The URL is of the form jdbc:oracle:<drivertype>:<user>/<password>@<database> and so there is no way that we can pass the properties map in here, the connection string.As I said, Oracle AS has an option that allows you to add properties in the datasource but CF does not (at least the vanilla CF8).
Hmm, have you tried posting this on the Adobe forums? There might be some guys there who can help you out. http://forums.adobe.com/community/coldfusion/coldfusion_database
Ciaran Archer
Thanks for the advice! The question was posted there and am awaiting for a reply there as well. Once I get a reply I will post the solution here.