<CFOBJECT ACTION=""> TYPE="JAVA"
CLASS="coldfusion.server.ServiceFactory"
NAME="factory">
<!-- new ds insert -->
<cfscript>
ds = 'coldfusion.server.ServiceFactory.DataSourceService.datasources';
ds = StructNew();
StructInsert(ds, "CLASS", "macromedia.jdbc.MacromediaDriver");
StructInsert(ds, "DRIVER", "MSSQLServer");
StructInsert(ds, "NAME", "#FORM.dsName#");
StructInsert(ds, "DATABASE", "#FORM.dbName#");
StructInsert(ds, "HOST", "#FORM.serverName#");
StructInsert(ds, "username", "#FORM.un#");
StructInsert(ds, "password", "#FORM.pwd#");
// chPWD = '#factory.DataSourceService.encryptPasword()#';
// encPWD
StructUpdate(ds, "password","#factory.DataSourceService.encryptPasword()#");
</cfscript>
> Chunshen (Don) Li wrote:
> >
> > Question on "coldfusion.server.ServiceFactory" CLASS,
> > it seems to have a method called getDataSourceService(), in the
> instances of MS SQL 7 and above, I would think it also has a method
> called AddDataSourceService() something
>
> You just create a structure with the right keys and values, and
> add that to
> coldfusion.server.ServiceFactory.DataSourceService.datasources
>
> To figure out which keys and values, dump
> coldfusion.server.ServiceFactory.DataSourceService.datasources
>
>
> > Then, encrypt the password, Jochem mentioned about encryptPassword()
> method, would its syntax be like coldfusion.server.ServiceFactory.
> DataSourceService['thisDS'].encryptPasword()?
>
> No, just
> coldfusion.server.ServiceFactory.DataSourceService.encryptPasword()
>
> Jochem
>
> --
> When you don't want to be surprised by the revolution
> organize one yourself
> - Loesje
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

