IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
Expand all | Collapse all

Changing JDBC connection for existing Services

  • 1.  Changing JDBC connection for existing Services

    Posted 10/14/03 05:19 AM

    Hi There,

    I’m working on an integration that I inherited from someone that makes heavy use of the JDBC adapter. The developer chose a non standard name for the connection, and chose to put it in the wrong package - so I basically need a new connection.

    However - there are already a heap of adapter services that have been defined and it will take some time to recreate them all.

    I looked through the .ndf files in the ns directory for the package hoping that the connection name would be somewhere in the XML and I could change it there… alas no - so I suspect it is held in the IRTNODE_PROPERTY which is not human readable.

    Has anyone worked out a way to do this?

    Steve


    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Changing JDBC connection for existing Services

    Posted 10/14/03 10:05 AM

    Renaming seems to be nearly impossible without creating all the adapters again. But you can move the connections to a different package as long as you keep exactly the same namespace.


    #webMethods
    #Adapters-and-E-Standards
    #Integration-Server-and-ESB


  • 3.  RE: Changing JDBC connection for existing Services

    Posted 10/15/03 02:30 AM

    Thanks Patrick

    I figured this was the case. I ended up recreating them all in the end…

    It’s for stupid things like this - that I really loath working with webMethods sometimes…

    Steve


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards


  • 4.  RE: Changing JDBC connection for existing Services

    Posted 02/10/05 04:39 PM

    Hi,

    I know that it is a very late reply to this one.

    [url=“{Khapre.org}”]{Khapre.org}

    Check this out.


    #Integration-Server-and-ESB
    #Adapters-and-E-Standards
    #webMethods


  • 5.  RE: Changing JDBC connection for existing Services

    Posted 02/10/05 04:39 PM

    Hi,

    I know that it is a very late reply to this one.

    [url=“{Khapre.org}”]{Khapre.org}

    Check this out.


    #Adapters-and-E-Standards
    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: Changing JDBC connection for existing Services

    Posted 08/26/05 11:01 PM


  • 7.  RE: Changing JDBC connection for existing Services

    Posted 12/29/06 11:42 AM

    Hi Chirag,
    I am trying to decode the information in the IRTNODE_PROPERTY of a SELECT JDBC ADAPTER SERVICE.The node.ndf I’m trying to decode is attached.Going by the suggested solution to decode the same, I wrote the test java program below.

    But still I dont see any information in the output.
    Can you suggest how to decode/de-serialize the info in the IRTNODE_PROPERTY.

    Thanks,
    -Sid

    import com.wm.util.coder.XMLCoder;
    import com.wm.util.;
    import java.io.
    ;
    public class DecodeAdapterInfo {
    public static void main(String a){
    try {
    System.out.println(“Start–”);
    FileInputStream istream = new FileInputStream(“C:\TEMP\ns\GE_OFS_JDBC_Adapter_Services\OFS_ServicesQuoteOrder_Source\GEPS_CS_FS_GC_INRS_HDR_STG_SelectSQL\node.ndf”);
    XMLCoder coder = new XMLCoder ();
    Values values = new Values();
    values = coder.decode(istream);
    java.util.Enumeration enum = values.sortedKeys();
    while(enum.hasMoreElements()){
    String JDBCInfo = (String)enum.nextElement();
    String JDBCValue = values.getString(“IRTNODE_PROPERTY”);
    System.out.println(JDBCInfo+“—”+JDBCValue);
    }
    String JDBCInfo = values.toString();
    System.out.println(JDBCInfo);
    System.out.println(“–End”);
    } catch(Exception e){
    e.printStackTrace();
    }
    }
    }


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards


  • 8.  RE: Changing JDBC connection for existing Services

    Posted 05/22/07 03:19 PM

    Use pub.art.service:setAdapterServiceNodeConnection … Changes the connection used by a given adapter service.


    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: Changing JDBC connection for existing Services

    Posted 03/20/12 07:43 PM

    hi, i managed to enable/disable jdbc adapters with IS shutted down, here is the java :

    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import com.wm.util.Base64;
    import com.wm.data.IData;
    import com.wm.data.IDataCursor;
    import com.wm.data.IDataUtil;
    import com.wm.util.Values;
    import com.wm.util.coder.*;

    public class changeJDBCStatut {

      public static String iDataNodePropertiesToString(IData data)
    {
    ByteArrayOutputStream bos = null;
    try {
    IDataBinCoder coder = new IDataBinCoder();
    bos = new ByteArrayOutputStream(1024);
    coder.encode(bos, data);
    String s = new String(Base64.encode(bos.toByteArray(), false), "UTF8");
    
    String str1 = s;
    return str1;
    }
    catch (Throwable tt)
    {
    }
    finally
    {
    if (bos != null) {
    try { bos.close(); } catch (Throwable tt) {
    }
    bos = null;
    }
    }
    return null;
    }
    
    
    public static IData stringToIDataNodeProperties(String encodedData) {
    ByteArrayInputStream bis = null;
    try {
    IDataBinCoder coder = new IDataBinCoder();
    bis = new ByteArrayInputStream(Base64.decode(encodedData.getBytes("UTF8")));
    IData localIData = coder.decode(bis);
    return localIData;
    }
    catch (Throwable tt)
    {
    }
    finally
    {
    if (bis != null) {
    try { bis.close(); } catch (Throwable tt) {
    }
    bis = null;
    }
    }
    return null;
    }
    
    
    
    protected static Values iDataToValues(IData i)
    {
    if (i.getClass() == Values.class) {
    return (Values)i;
    }
    Values v = new Values();
    IDataUtil.copy(i, v);
    return v;
    }
    
    
    
    public static void main(String argv[]) {
    
    if(argv.length != 2)
    {
    System.out.println("Le nombre d'arguments donnees n'est pas bon.\nAttendu : 2\nTrouve :" + argv.length);
    System.exit(1);
    }
    // On va affecter les paramètres par défaut
    String leFichier=argv[0];
    String statut=argv[1];
    
    try {
    
    //File fXmlFile = new File("E:\\DONNEES\MES_DOCUMENTS\\JPE\\PARTAGE\\node.ndf");
    File fXmlFile = new File(leFichier);
    InputStream essaiInput = new FileInputStream(fXmlFile);
    XMLCoder xmlCoderClass2 = new XMLCoder();
    Values essaiValues = xmlCoderClass2.decode(essaiInput);
    
    String objTest = (String)essaiValues.getValue("IRTNODE_PROPERTY");
    
    IData essaiData = stringToIDataNodeProperties(objTest);
    
    IDataCursor cursor = essaiData.getCursor();
    while(cursor.hasMoreData()) {
    //System.out.println("\n");
    //System.out.println(cursor.getKey());
    //System.out.println("\n");
    if(cursor.getKey()!=null) {
    if(cursor.getKey().equals("connectionEnabled")){
    //cursor.setValue("false");
    cursor.setValue(statut);
    }
    }
    cursor.next();
    }
    
    String objTestOut = iDataNodePropertiesToString(essaiData);
    cursor.destroy();
    essaiValues.setValue("IRTNODE_PROPERTY", objTestOut);
    
    OutputStream essaiOutPut = new FileOutputStream(fXmlFile);
    xmlCoderClass2.encode(essaiOutPut, essaiValues);
    
    } catch (Exception e) {
    e.printStackTrace();
    }
    System.exit(0);
    
    }
    

    julien PHILIPPE, ATOS france.


    #Integration-Server-and-ESB
    #Adapters-and-E-Standards
    #webMethods