5 Replies Latest reply on Nov 14, 2011 10:52 AM by Ramesh Reddy

    How can i set the connection programatically for source model in a VDB?

    Farrukh Ihtisham Newbie

      Hello,

       

      I have scenario in which I want to set the "data source/connection profile" programatically. Consider the following example.

       

      1- Create a source model using sql server connection say ''SQLSourceA"

      2- Create a view model using above source model

      3- Create a virtual db say "Sample.vdb" that includes above models

      4- Deploy the vdb which will result in creation of "Sample.vdb", SQLSourceA-ds.xml files in the jboss AS deploy folder.

      5- Create a copy of SQLSourceA-ds.xml as SQLSourceA-ds(2).xml. In SQLSourceA-ds(2).xml change jndi name and connection information to point to some other sql server instance.

       

      Now when I will query this deployed vdb for SQLSourceA model, the connection information stored in SQLSourceA-ds.xml will be used by vdb. I have scenario where in my java client, I want vdb to use SQLSourceA-ds(2).xml instead of SQLSourceA-ds(2).xml

       

      Is it possible to change the "data source/connection profile" of the source model packaged in vdb programatically to use the SQLSourceA-ds(2).xml?

       

      Thanks,

      Farrukh