Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Scripting for data access resources > Configure data access with wsadmin scripting


Configure custom properties for a v4.0 data source using wsadmin.sh

We can use scripting and wsadmin.sh to configure custom properties for a v4.0 data source.

See the topic about starting wsadmin.sh.

Complete the steps in this topic to configure custom properties for a v4.0 data source.


Procedure

  1. Identify the parent ID.

      ### Jacl

      set new40ds [$AdminConfig getid /Cell:mycell/Node:mynode/
      JDBCProvider:JDBC1/WAS40DataSource:was4DS1/]
      

      ### 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.

      ### Jacl

      set propSet [$AdminConfig showAttribute $new40ds propertySet]
      
      

      ### Jython

      propSet = AdminConfig.showAttribute(new40ds, 'propertySet')
      print propSet
      

    Example output:

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

  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.

    • Use 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]
      

    • Use Jython to set up the server name:

      name = ['name', 'serverName']
      rpAttrs1 = [name]
      

    • Use Jacl to set up the port number:

      set name [list name "portNumber"]
      set value [list value 50000]
      set rpAttrs2 [list $name $value]
      

    • Use Jython to set up the port number:

      name = ['name', 'portNumber']
      rpAttrs2 = [name]
      

  4. Create a J2EE Resource Property.

      ### Jacl

      $AdminConfig create J2EEResourceProperty $propSet $rpAttrs1
      $AdminConfig create J2EEResourceProperty $propSet $rpAttrs2
      

      ### 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.

  6. Synchronize the node.


Start the wsadmin scripting client using wsadmin.sh
Use the wsadmin scripting AdminConfig object for scripted administration
Saving configuration changes with wsadmin.sh
Synchronize nodes using wsadmin.sh


Related


Commands for the AdminConfig object using wsadmin.sh

+

Search Tips   |   Advanced Search