Configuring custom properties for a Version 4.0 data source using wsadmin scripting

You can use scripting and the wsadmin tool to configure custom properties for a Version 4.0 data source.

Before you begin

Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client using wsadmin scripting article for more information.

About this task

Perform the following steps to configure custom properties for a Version 4.0 data source:

Procedure

  1. Identify the parent ID:
    • Using Jacl:

      set new40ds [$AdminConfig getid /Cell:mycell/Node:mynode/
      JDBCProvider:JDBC1/WAS40DataSource:was4DS1/]
    • Using Jython:
      new40ds = AdminConfig.getid('/Cell:mycell/Node:mynode/
      JDBCProvider:JDBC1/WAS40DataSource:was4DS1/')
      print new40ds
    Example output:
    was4DS1(cells/mycell/nodes/mynodes|resources.xml$WAS40DataSource_1)
  2. Get required attributes:
    • Using Jacl:

      set propSet [$AdminConfig showAttribute $new40ds propertySet]
      
    • Using Jython:
      propSet = AdminConfig.showAttribute(new40ds, 'propertySet') 
      print propSet
    Example output:
    (cells/mycell/nodes/mynode|resources.xml#J2EEResourcePropertySet_9)
    For transitioning users: In Version 6.1, quotation marks exist in the output of this command with the propertySet parameter. The quotation marks, which have been removed in this release, caused difficulties when you parsed the output.trns
  3. Optional: Set up attributes for the server name and port number.
    Attention: This step describes optional attributes that might be required by your J2EE Resource Property. Other attributes might be required.
    • Using Jacl to set up the server name:

      set name [list name "serverName"]
      set value [list value db2was.austin.ibm.com]
      set rpAttrs1 [list $name $value]
    • Using Jython to set up the server name:

      name = ['name', 'serverName']
      rpAttrs1 = [name]
    • Using Jacl to set up the port number:

      set name [list name "portNumber"]
      set value [list value 50000]
      set rpAttrs2 [list $name $value]
    • Using Jython to set up the port number:

      name = ['name', 'portNumber']
      rpAttrs2 = [name]
  4. Create J2EE Resource Property:
    • Using Jacl:

      $AdminConfig create J2EEResourceProperty $propSet $rpAttrs1
      $AdminConfig create J2EEResourceProperty $propSet $rpAttrs2
    • Using Jython:
      print AdminConfig.create('J2EEResourceProperty', propSet, rpAttrs1)
      print AdminConfig.create('J2EEResourceProperty', propSet, rpAttrs2)
    Example output:
    serverName(cells/cell_name|resources.xml#J2EEResourceProperty_1236708692906)
    serverName(cells/cell_name|resources.xml#J2EEResourceProperty_1236708728281)
  5. Save the configuration changes. For more information, see Saving configuration changes with the wsadmin tool.
  6. Synchronize the node. For more information, see Synchronizing nodes using the wsadmin scripting tool.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Oct 20, 2010 7:53:43 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-nd-dist&topic=txml_wascustom
File name: txml_wascustom.html