Answered
Connecting to MS SQL 2005 via JDBC Driver
I have an application in which I use Java to abstract
database elements as objects and handle most of the server-side
processing. This is done by creating a Java object via
CreateObject(). The Java then connects to a MS SQL 2005 database
using the JDBC 1.1 Driver.
The following tutorial explains how to set this up: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=ded4216b. It instructs you to create a Data Source, much like how you typically would in "regular" ColdFusion applications. Then, using some simple Java, I am successfully able to connect to the database, query it, and get results. The connection code is attached.
As you can see, I am still passing all the connection parameters to the Database class constructor. My question is: how would I go about connecting to the database by simply using the Data Source Name, as you would, again, in "regular" ColdFusion applications. Is this possible at all?
Thanks!
The following tutorial explains how to set this up: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=ded4216b. It instructs you to create a Data Source, much like how you typically would in "regular" ColdFusion applications. Then, using some simple Java, I am successfully able to connect to the database, query it, and get results. The connection code is attached.
As you can see, I am still passing all the connection parameters to the Database class constructor. My question is: how would I go about connecting to the database by simply using the Data Source Name, as you would, again, in "regular" ColdFusion applications. Is this possible at all?
Thanks!