Weblogic :GridLink data source using WLST


  1. Log in as a wls user to shell and start WLST:
    [wls@prod01]$ $WL_HOME/common/bin/wlst.sh
  2. Connect to the Administration Server using wlsadmin as the user, <pwd> as the password, and t3://adminhost.domain.local:7001 as the server URL:
    wls:/offline> connect("wlsadmin","<pwd>","t3://adminhost.domain.local:7001")
  3. Run the following WLST commands to create the GridLink data source:
    edit()
    startEdit()
    
    cmo.createJDBCSystemResource('ds-GridLinkXA')
    cd('/JDBCSystemResources/ds-GridLinkXA/JDBCResource/ds-GridLinkXA')
    cmo.setName('ds-GridLinkXA')
    cd('/JDBCSystemResources/ds-GridLinkXA/JDBCResource/ds-GridLinkXA/JDBCDataSourceParams/ds-GridLinkXA')
    set('JNDINames',jarray.array([String('jdbc/ds-GridLinkXA')], String))
    cd('/JDBCSystemResources/ds-GridLinkXA/JDBCResource/ds-GridLinkXA/JDBCDriverParams/ds-GridLinkXA')
    cmo.setUrl('jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost-rac01)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost-rac02)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=dbservice)))\r\n')
    cmo.setDriverName('oracle.jdbc.xa.client.OracleXADataSource')
    cmo.setPassword('dbpwd')
    cd('/JDBCSystemResources/ds-GridLinkXA/JDBCResource/ds-GridLinkXA/JDBCConnectionPoolParams/ds-GridLinkXA')
    cmo.setTestTableName('SQL SELECT 1 FROM DUAL\r\n')
    
    cd('/JDBCSystemResources/ds-GridLinkXA/JDBCResource/ds-GridLinkXA/JDBCDriverParams/ds-GridLinkXA/Properties/ds-GridLinkXA')
    cmo.createProperty('user')
    cd('/JDBCSystemResources/ds-GridLinkXA/JDBCResource/ds-GridLinkXA/JDBCDriverParams/ds-GridLinkXA/Properties/ds-GridLinkXA/Properties/user')
    cmo.setValue('dbuser')
    cd('/JDBCSystemResources/ds-GridLinkXA/JDBCResource/ds-GridLinkXA/JDBCDataSourceParams/ds-GridLinkXA')
    cmo.setGlobalTransactionsProtocol('TwoPhaseCommit')
    cd('/JDBCSystemResources/ds-GridLinkXA/JDBCResource/ds-GridLinkXA/JDBCOracleParams/ds-GridLinkXA')
    cmo.setFanEnabled(true)
    cmo.setOnsWalletFile('')
    cmo.unSet('OnsWalletPasswordEncrypted')
    cmo.setOnsNodeList('onshost:6200 \r\n')
    cmo.setFanEnabled(true)
    cmo.setOnsWalletFile('')
    cmo.unSet('OnsWalletPasswordEncrypted')
    cmo.setOnsNodeList('onshost:6200 \r\n')
    cd('/JDBCSystemResources/ds-GridLinkXA')
    set('Targets',jarray.array([ObjectName('com.bea:Name=PROD_Cluster,Type=Cluster')], ObjectName))activate()
    exit()