Configure new data sources using scripting

 

Procedure

  1. Start wsadmin

  2. Identify the parent ID:

    • Jacl:

      set newjdbc [$AdminConfig getid /Cell:mycell/Node:mynode/JDBCProvider:JDBC1/]
      

    • Jython

      newjdbc = AdminConfig.getid('/Cell:mycell/Node:mynode/JDBCProvider:JDBC1/')
      print newjdbc
      

    Example output:

    JDBC1(cells/mycell/nodes/mynode|resources.xml#JDBCProvider_1)
    

  3. Obtain the required attributes:

    • Jacl:

      $AdminConfig required DataSource
      

    • Jython

      print AdminConfig.required('DataSource')
      

    Example output:

    Attribute   Type
    name     String
    

  4. Setting up required attributes:

    • Jacl:

      set name [list name DS1]
      set dsAttrs [list $name]
      

    • Jython

      name = ['name', 'DS1']
      dsAttrs = [name]
      

  5. Create a data source:

    • Jacl:

      set newds [$AdminConfig create DataSource $newjdbc $dsAttrs]
      $AdminConfig save
      

    • Jython

      newds = AdminConfig.create('DataSource', newjdbc, dsAttrs)
      print newds
      

    Example output:

    DS1(cells/mycell/nodes/mynode|resources.xml#DataSource_1)
    

  6. In a network deployment environment only, synchronize the node.


 

See Also


AdminConfig object for scripted administration

 

See Also


Commands for the AdminConfig object