Link to home
Start Free TrialLog in
Avatar of demerg
demerg

asked on

I need to create a DSN Less connection in ColdFusion 10 to an Oracle 10g database

Need to create a DSN less connection from ColdFusion 10 to an Oracle 10 or 11g database.

Create a connection to the an Oracle 10g database without using ColdFusion Administrator.

I have searched the internert and there is reference to a CFQuery attribute called dbType dynamic with another called connectstring but I can't get these working.

We already have an application module created that we need to create a connection to an Oracle 10g database without using the ColdFusion Admin to make the connection.

Please Assist
Avatar of _agx_
_agx_
Flag of United States of America image

I have searched the internert and there is reference to a CFQuery attribute called dbType dynamic with another called connectstring but I can't get these working.

DSN-less queries were only supported in older versions of CF. They discontinued support for them a while back. So that's why it doesn't work in CF10.

It's possible to connect to a database without a DSN, but it's a LOT more complicated, and less performant.  So I wouldn't recommend it.. Can you explain more about why you can't set up  a dsn?

In any case, if you really must do this, here's a simplified connection example for SQL server, but the concept is the same for Oracle, just change the driver/connection settings:
https://www.experts-exchange.com/questions/26371168/Cold-Fusion-DSN-less-Connection-to-MS-SQL-Database.html?anchorAnswerId=33337078#a33337078
ASKER CERTIFIED SOLUTION
Avatar of Brijesh Chauhan
Brijesh Chauhan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Also, just read the question again, this will NOT work with CFQUERY, simply because doing this we are bypassing CFQUERY Tags, and this CFQUERYPARAM will also not work.....
brijeshchauhan - FYI that's exactly what I described above, just with the oracle driver.

this will NOT work with CFQUERY, simply because doing this we are bypassing CFQUERY Tags, and this CFQUERYPARAM will also not work.....

Right, but still possible. Since you're using low level jdbc stuff, you have to use bind variables instead of cfqueryparam.  Definitely a lot more work than cfquery. That's why I said I don't recommend it.
Avatar of demerg
demerg

ASKER

Tnx