Hi steve,

here is some code i have used from cfmx to get a connection to a database

<cffunction name="dump">
 <cfargument name="var">
 <cfdump var="#var#">
</cffunction>

<cfscript>

DriverManager = CreateObject("java",
"com.microsoft.jdbc.sqlserver.SQLServerDriver");
DriverManager.init();

conn = DriverManager.connect(javacast("string",
"jdbc:microsoft:sqlserver://my_server_name:1433;User=sa;Password=my_password
"), CreateObject("java", "java.util.Properties").init());

//example
mdata = conn.getMetaData();
rsCatalog = mdata.getCatalogs();

query = CreateObject("java", "coldfusion.sql.QueryTable");
query = query.init(rsCatalog);

dump(query);
</cfscript>


"Steve Onnis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Ello ello ello
>
> Is there any way at all to create a dynamic connection to a database?  I
know you can't use the connection string attribute now so
> was wondering if anyone knows of another way.
>
> I guess you could create a datasource on the fly using the connection
string but there must be an easier way
>
> Steve
>
>
>



---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to