We had a similar problem - pointing the datasources to different databases on startup,
without hacking the each individual sds file. So this may be of some help to your
problem.
We are overriding some methods of the datasource
e.g.
public class <datasource> extends spider.database.CSpDataSource
//]]SPIDER_CLASS END
{
public String [] getRuntimePropertyValueList() {
String [] t = {"jdbc:sybase:Tds:<machine>:<port>/<dbname", "JDBC"};
return t;
}
public String getRuntimePassword() {
return "your password";
}
public String getRuntimeUserID() {
return "your userid";
}
}
As long as those methods return the 'right' thing, you should be cooking .....
Cheers Stephan
[EMAIL PROTECTED] wrote:
>In ND 4, you can use the following code inside the onBeforeExecuteEvent of the Data
>Object:>
>CSpDataSource dsToReset = event.getDBRequest().getDBConnection().getDataSource();
>dsToReset.setRuntimeServer(resetToDataSource.getServerName());
>dsToReset.setRuntimeUserID(resetToDataSource.getDBUserID());
>dsToReset.setRuntimePassword(resetToDataSource.getDBPassword());
>event.getDBRequest().setDBConnection(new CSpDBConnection(dsToReset));
>
>It works fine.
>
>But in ND5, setRuntimeServer does not work. So, I am not sure what would be the
>solution.
>Somehow the implementation of setRuntimeServer of ND5 is different to that in ND4.
>(*there are still
>other API implementation differences between ND4 to ND5*). Is there a compiled list
>of these
>differences somewhere ?
>
>Pax
>
>[EMAIL PROTECTED] wrote:
>>I have a project which needs to run against any of four identical database servers
>across the world.>
>>The database to run against is selected by the user via radio buttons. The choice
>is then stored in a USERSESSION variable.
>>
>>I have a little routine that uses setRuntimeServer and setRuntimeDatabaseName
>depending on this USERSESSION variable.
>>
>>I call this routine from ANY search page's onBeforeLoad event and it works reliably
>for data in drop downs.
>>
>>However, it DOES NOT work reliably for data objects, particularly for stored
>procedures. I tried putting the call to our function on the
>>onBeforeExecute event of the data objects - it does not help. Most of the time I
>seem to be getting data back from the server that
>>I selected via my radio buttons, but sometimes, I get data which obviously comes
>from another server. This obviously seems to happen more
>>when I run several users at the same time (caching ?) but even with just one user, I
>sometimes get the wrong data back.
>>
>>ANY CLUES WOULD BE APPRECIATED !
>>
>>System :
>>
>>MS SQL Server databases (6.5)
>>ND 4.1.2.24 (6 CP workers and 6 RDBMS workers
>>App Server and Web servers run on WinNT 4.0 sevice pack 3
>>
>>Thanks,
>>
>>Wim Petersen
>>
>
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]