OK, I messed up with objects.  With your code, the password encryption failed.  Err msg:
'An exception occurred during method selection process for Method encryptPasword The cause of this exception was that either there are no methods with the the specified method name and argument types, or the method encryptPasword is overloaded with arguments types that Coldfusion can't decipher reliablly. Use javacast function to reduce ambiguity.'
Line 61, that is, ds.password = ds_service.encryptPasword(FORM.pwd);

Thanks.

Don
> <CFOBJECT ACTION="" TYPE="JAVA"
> CLASS="coldfusion.server.ServiceFactory" NAME="factory">
>
> <cfscript>
> ds_service = factory.DataSourceService;
>
> ds = StructNew();
> ds.CLASS = "macromedia.jdbc.MacromediaDriver";
> ds.DRIVER = "MSSQLServer";
> ds.NAME = FORM.dsName;
> ds.DATABASE = FORM.dbName;
> ds.HOST = FORM.serverName;
> ds.username = FORM.un;
> ds.password = ds_service.encryptPasword(FORM.pwd);
>
> urlPath = StructNew();
> urlPath.DATABASE = FORM.dbName;
> urlPath.HOST = FORM.serverName;
> urlPath.PORT = 1433;
> urlPath.SELECTMETHOD = "direct";
> urlPath.SENDSTRINGPARAMETERSASUNICODE = "false";
> // You might need to fix the following line, don't know if URLMAP
> is the correct name
> ds.urlmap = urlPath;
>
> ds_service["datasources"][FORM.dsName] = ds;
>
> </cfscript>  
>
> <cfdump var = "#factory.DataSourceService.datasources#">
>
> > Execution results:
> > 1) cfdump displays all datasources of the CFMX installation YET the
> new ds is not added;
>
> There are various errors in the code where you use names of
> objects as strings instead of objects. Also, you assign values
> twice, which means the first value is overwritten.
>
>
> > 2) error code/msg/detail is EMPTY
>
> The code you gave shouldn't return an error because it is
> syntactically correct. It just doesn't do what you want it to do
> either.
>
> 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]

Reply via email to