Change Datasaource info using a Script - Websphere

This is a discussion on Change Datasaource info using a Script - Websphere ; Hello All, My application needs to toggle between 2 DBs, So I was just wondering ,if it would be possible to change the JDBC URL and the connect info using a wsadmin scripting client with jacl or jython script? ....Any ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Change Datasaource info using a Script

  1. Change Datasaource info using a Script

    Hello All,

    My application needs to toggle between 2 DBs, So I was just wondering ,if it would be possible to change the JDBC URL and the connect info using a wsadmin scripting client with jacl or jython script? ....Any ideas on how to get started?.

    Cheers!
    Amulya

  2. Re: Change Datasaource info using a Script

    amulya.green@yahoo.com wrote:
    > Hello All,
    >
    > My application needs to toggle between 2 DBs, So I was just wondering
    > ,if it would be possible to change the JDBC URL and the connect info
    > using a wsadmin scripting client with jacl or jython script? ....Any
    > ideas on how to get started?.


    what do you mean by "toggle"? Surely you don't mean at runtime?

  3. Re: Change Datasaource info using a Script

    On Apr 19, 2:33 am, Paul Ilechko wrote:
    > amulya.gr...@yahoo.com wrote:
    > > Hello All,

    >
    > > My application needs to toggle between 2 DBs, So I was just wondering
    > > ,if it would be possible to change the JDBC URL and the connect info
    > > using a wsadmin scripting client with jacl or jython script? ....Any
    > > ideas on how to get started?.

    >
    > what do you mean by "toggle"? Surely you don't mean at runtime?




    I assume you need to change the properties associated with the
    datasource jndi reference.

    See the link for a create datasource script. Just amend it to modify
    an existing datasource. The proc is installDataSource_proc.tcl.

    http://www.websphereconsultant.com/W...doc/index.html


  4. Re: Change Datasaource info using a Script

    Paul,
    This toggle will not be at runtime. The development team will make a request to switch to a different DB and thats when the script comes in to picture. Thanks.

  5. Re: Change Datasaource info using a Script

    amulya.green@yahoo.com wrote:
    > Paul, This toggle will not be at runtime. The development team will
    > make a request to switch to a different DB and thats when the script
    > comes in to picture. Thanks.


    So why not just define two different datasources? Then the development
    team can just change their resource reference to point to the right one
    when they re-deploy their application.

  6. Re: Change Datasaource info using a Script

    I have tried to create the second data source, but it would'nt let me do so because, the jndi reference name is same for both of 'em. The only thing thats different is the JDBC URL and the connect account. Thats why I think its a little complicated. Thanks.

  7. Re: Change Datasaource info using a Script

    amulya.green@yahoo.com wrote:
    > I have tried to create the second data source, but it would'nt let me
    > do so because, the jndi reference name is same for both of 'em. The
    > only thing thats different is the JDBC URL and the connect account.
    > Thats why I think its a little complicated. Thanks.



    So give it a different JNDI reference name. I don't see what the problem
    is, assuming of course that your developers didn't do anything as stupid
    as use hard coded JNDI names instead of using resource references.

+ Reply to Thread