<cflock name="serviceFactory" type="exclusive" timeout="10">
<cfscript>
factory = CreateObject("java",
"coldfusion.server.ServiceFactory");
ds_service = factory.datasourceservice;
d_sources = ds_service.datasources;
</cfscript>
</cflock>
> like how to do you find the name of an existing datasource in order to model it
To list all the datasources:
<cfoutput>#StructKeyList(d_sources)#</cfoutput>
> how do you check to ensure there aren� any existing DSNs with that same name
Presuming your new datasource is named "foobar":
<cfif StructKeyExists(d_sources, "foobar")>
<cfthrow message="A datasource with that name already exists.">
</cfif>
> how do you associate the actual DB with the DSN you created
That depends on the driver, just create one using the
administrator and then have a good look at the structure that is
created. For instance, for PostgreSQL it is controlled
exclusively by the URL, while for Access with Unicode you need to
set the URL, the urlmap.databasefile and the
urlmap.connectionprops.databasefile.
Jochem
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

