Datasourceisvalid()

Checks to see if a given datasource has been previously registered using DataSourceCreate()

Usage

BOOLEAN = Datasourceisvalid( datasource )
Argument Summary
datasource datasource name to check

Calling

Supports named-parameter calling allowing you to use the function like:

Datasourceisvalid(
   datasource=?
);

Supports passing parameters as a structure using ArgumentCollection:

Datasourceisvalid( ArgumentCollection={
   datasource : ?
} );

Extra

The following shows an example of creating a datasource using CFML.

<cfscript>
if ( !DataSourceIsValid("myds") ){
  var ds = {
    username : "user1",
    password : "password1",
    databasename : "MyDatabase",
    drivername : "org.gjt.mm.mysql.Driver",
    hoststring : "jdbc:mysql://8.8.8.8/MyDatabase?useUnicode=true&characterEncoding=UTF-8"
  };

  DataSourceCreate( "myds", ds );
}
</cfscript>