Ask a Question related to Coldfusion Database Access, Design and Development.
-
g0nzolo #1
Dynamic Datasources?
I am porting an app from PHP to CF. The app requires the functionality to
perform queries on different databases. I cannot utilize the CF Admin as many
of these databases will be created dynamically.
In PHP, I would call the function mysql_select_db() to switch to a different
database at will, assuming I had already supplied the correct permissions.
How can this be done in CF MX 6.1?
g0nzolo Guest
-
Export Datasources
I would like to know if you can export the data sources and/or copy the file they are stored in from one coldfusion server to another? If so, what... -
Use CF Datasources outside CF
I need to create a JSP on the coldfusion server, and access coldfusion datasources in that JSP. Is there anyway to do this in CF6.1 or CF7. ... -
List all available Datasources
Hi@all! How can I do it, that I get all datasources that are registerd in the CF-Server? I tried somethin like that but it did'nt work: ... -
Listing Datasources in MX 6.1
Anyone know what's up with CFMX 7 and doing this same thing? It's clearly been ripped out and re-done with the new funtionality in the api's...... -
DataSources from Session??
I have some server controls I've built that store their properties in the ViewState like good little controls :) However, When I set my... -
BKBK #2
Re: Dynamic Datasources?
> I cannot utilize the CF Admin as many of these databases will be created dynamically.
You indeed can [url]http://livedocs.macromedia.com/coldfusion/7/htmldocs/00001734.htm[/url]
..
BKBK Guest
-
g0nzolo #3
Re: Dynamic Datasources?
Originally posted by: BKBK
dynamically.> I cannot utilize the CF Admin as many of these databases will be created
You can in fact
[url]http://livedocs.macromedia.com/coldfusion/7/htmldocs/00001734.htm[/url].
Wow, thanks. I can't believe I didn't come across this earlier ... I've been
searching for day. Now another issue ... I can create the datasources, but
not set the password? It's not even an attribute in the documentation. Anyone
know how to do this?
g0nzolo Guest
-
BKBK #4
Re: Dynamic Datasources?
> I can create the datasources, but not set the password? It's not even an
I think it's because the password is a property of the database server rather> attribute in the documentation.
than of the Coldfusion server.
Anyone know how to ... set the password?
That depends on which database server you use. In
[url]http://dev.mysql.com/doc/refman/5.0/en/[/url] and put "password" in the search engine.
BKBK Guest
-
Mountain Lover #5
Re: Dynamic Datasources?
[url]http://localhost/cfide/adminapi/datasource.cfc[/url] or something similar will
give you all the methods available.
HTH,
Tim
--
Tim Carley
[url]www.recfusion.com[/url]
[email]info@NOSPAMINGrecfusion.com[/email]
Mountain Lover Guest
-
BKBK #6
Re: Dynamic Datasources?
[url]http://localhost/cfide/adminapi/datasource.cfc[/url] or something similar will
give you all the methods available.
Some editions of Coldfusion may not come equipped with all the database drivers, though.
BKBK Guest
-
g0nzolo #7
Re: Dynamic Datasources?
Well, its definitly odd. Even listed in this component is the password
attribute:
setMSAccess
public setMSAccess ( required string dsn, required string databasefile, string
originaldsn="", string driver="MSAccess", string
class="macromedia.jdbc.MacromediaDriver", string port="19998", string
username="System", string password="", string epassword="[runtime expression]",
string description="", string args, string systemDatabaseFile, string
defaultusername="", numeric maxBufferSize, numeric pageTimeout="600", boolean
TimeStampAsString="no", numeric timeout, numeric interval, numeric
login_timeout, numeric buffer, numeric blob_buffer, boolean
enablemaxconnections, numeric maxconnections, boolean pooling, boolean disable,
boolean enable_clob, boolean enable_blob, boolean select, boolean create,
boolean grant, boolean insert, boolean drop, boolean revoke, boolean update,
boolean alter, boolean storedproc, boolean delete )
Output: enabled
Parameters:
dsn: string, required, dsn - ColdFusion datasource name
databasefile: string, required, databasefile - database name that
corresponds to the data source.
originaldsn: string, optional, originaldsn - original ColdFusion datasource
name, if you are renaming this dsn.
driver: string, optional, driver - JDBC driver
class: string, optional, class - JDBC class file
port: string, optional, port - port that is used to access the database
server. (default 19998)
username: string, optional, username
password: string, optional, password
epassword: string, optional, epassword - confirmation password, must be the
same as password (default is password)
description: string, optional, description
args: string, optional, args - connection sting arguments format like this
(arg1=argvalue;arg2=argvalue)
systemDatabaseFile: string, optional, systemDatabaseFile - database name
that corresponds to the data source.
defaultusername: string, optional, defaultusername
maxBufferSize: numeric, optional, maxBufferSize
pageTimeout: numeric, optional, pageTimeout
TimeStampAsString: boolean, optional, TimeStampAsString
timeout: numeric, optional, timeout - a time, in minutes, that the server
allows a data source connection to remain inactive before closing that
connection.
interval: numeric, optional, interval - a time, in minutes, that the server
waits before closing an expired data source connection.
login_timeout: numeric, optional, login_timeout - Login Timeout (sec)
buffer: numeric, optional, buffer - Long Text Buffer (chr - default 64000)
blob_buffer: numeric, optional, blob_buffer - Blob Buffer(bytes)
enablemaxconnections: boolean, optional, enablemaxconnections - enable
limit Connections
maxconnections: numeric, optional, maxconnections - Limit Connections to
this max amount
pooling: boolean, optional, pooling - enable server connection pooling for
your data source.
disable: boolean, optional, disable - disable connections to data sources.
enable_clob: boolean, optional, enable_clob - enable long text retrieval.
enable_blob: boolean, optional, enable_blob - enable binary large object
retrieval.
select: boolean, optional, select - allow sql SELECT statements
create: boolean, optional, create - allow sql CREATE statements
grant: boolean, optional, grant - allow sql GRANT statements
insert: boolean, optional, insert - allow sql INSERT statements
drop: boolean, optional, drop - allow sql DROP statements
revoke: boolean, optional, revoke - allow sql REVOKE statements
update: boolean, optional, update - allow sql UPDATE statements
alter: boolean, optional, alter - allow sql ALTER statements
storedproc: boolean, optional, storedproc - allow sql stored procedure calls
delete: boolean, optional, delete - allow sql DELETE statements
What I get using the password attribute (have tried using epassword as well in
combination) is a JAVA error
java.lang.ArrayIndexOutOfBoundsException: 9
I have updated the macromedia_drivers.jar to Version 3.4 Build 50 ... Any
other thoughts? :confused;
g0nzolo Guest
-
BKBK #8
Re: Dynamic Datasources?
Have you tried this MySQL suggestion I suggested earlier? It works, if you're Root.
<cfquery datasource="myDSN" name="pw_setter_changer">
SET PASSWORD = PASSWORD('myNewPW123');
</cfquery>
BKBK Guest
-
BKBK #9
Re: Dynamic Datasources?
java.lang.ArrayIndexOutOfBoundsException: 9
I would take this as a hint to use all the arguments in the function setMySQL.
BKBK Guest



Reply With Quote

