Ask a Question related to Coldfusion Database Access, Design and Development.
-
Walden #1
Connecting withOUT Data Source
Is anyone aware of a way to provide JDBC connection strings to CF at runtime?
We have an application that connects to a number of databases depending on the
user logging in. Basically each user connects to their own database. Each time
I bring a new user onboard I have to create a data source in the admin. I want
to avoid this.
The app is a mix of CF and ASP.NET and on the .NET side I simply put the new
connection string in a database and the .NET retrieves it and connects using
it, I want to create the same functionality on the CF side.
Am I forced to use the data sources defined in the admin?
Thanks,
-Walden
Walden Guest
-
Problem connecting to Data Source
Hi, I seem to be having a problem connecting to a data source, now that I have changed the cfform to flash format. This is the error I am... -
connecting to data source
After accessing the Coldfusion administrator \ Data sources. Eventhough many datasources were set up, none of them could be accessed. The following... -
Error Connecting SQL 2000 Data Source to CF
I am trying to setup SQL 2000 in conjunction with CF MX 7. CF is serving pages fine and I created a new account in SQL and that is working fine. I... -
Problem connecting to ODBC data source from CFAdministrator
I've set up the data source called vs28718_1 for Windows Authentication but I get the following error in CF Administrator when submitting the data... -
Problem connecting site to data source
:light; Thanks for guiding. I had the same problem and just found what I missed it. Thanks again -
CFGoneWild #2
Re: Connecting withOUT Data Source
If you are using CF MX 7, you have to use the Admin APIs. Below is an example
of how to create a data source in CF without using the Administration Console:
<cfscript>
// Login is always required. This example uses a single line of code.
createObject("component","cfide.adminapi.administr ator").login("admin");
// Instantiate the data source object.
myObj = createObject("component","cfide.adminapi.datasourc e");
// Required arguments for a data source.
stDSN = structNew();
stDSN.driver = "MSSQLServer";
stDSN.name="northwind_MSSQL";
stDSN.host = "DARRELL";
stDSN.port = "1433";
stDSN.database = "northwind";
stDSN.username = "sa";
// Optional and advanced arguments.
stDSN.login_timeout = "29";
stDSN.timeout = "23";
stDSN.interval = 6;
stDSN.buffer = "64000";
stDSN.blob_buffer = "64000";
stDSN.setStringParameterAsUnicode = "false";
stDSN.description = "Northwind SQL Server";
stDSN.pooling = true;
stDSN.maxpooledstatements = 999;
stDSN.enableMaxConnections = "true";
stDSN.maxConnections = "299";
stDSN.enable_clob = true;
stDSN.enable_blob = true;
stDSN.disable = false;
stDSN.storedProc = true;
stDSN.alter = false;
stDSN.grant = true;
stDSN.select = true;
stDSN.update = true;
stDSN.create = true;
stDSN.delete = true;
stDSN.drop = false;
stDSN.revoke = false;
//Create a DSN.
myObj.setMSSQL(argumentCollection=stDSN);
</cfscript>
for more info, check out:
[url]http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/[/url]
wwhelp.htm?context=ColdFusion_Documentation&file=0 0001734.htm
CFGoneWild Guest
-
Walden #3
Re: Connecting withOUT Data Source
Thanks for the info -- I'm not on 7, but I suppose we could go there. Still,
the API allows us to create data sources w/out needing the admin console, but
I'd still rather simply supply the connection string at runtime. I've got a
centralized database that describes a "client" and what database & server they
are on. I'd rather have to just change that one DB and have all the code see
the change. Works great in .NET where I don't need a data source defined, it's
more of a pain in java (CF) where I do need the data source defined.
Still, at least the API removes the need to visit the admin screen on the
servers.
Thanks,
-Walden
Walden Guest
-
philh #4
Re: Connecting withOUT Data Source
DSN-less connections lived and died with CF5's CFQUERY tag. You're pretty much stuck with the ODBC-style connection in MX.
philh Guest
-
Walden #5
Re: Connecting withOUT Data Source
That's what I was afraid of. In this world of "software as a service" and application service providers, it's really a shame to have to deal with such a limitation. But oh well.. Thanks.
-Walden
Walden Guest



Reply With Quote

