wlshell Scripts

The following section contains sample wlshell scripts. More scripts can be found in the distribution files, under the "scripts" directory and at the online scripts catalog.

JDBC Data Source

This script creates a JDBC Data Source in a WebLogic Server version 9 and 10.

  ############################################
  #Common useful definitions
  #keys
  keys Type Name
  #Configuration Manager
  cm = edit.com.bea:/weblogic.management.mbeanservers.edit.ConfigurationManagerMBean/ConfigurationManager
  #domain
  domain=myWDomain100
  #server
  server=AdminServer
  
  #data source
  ds=myDataSource
  
  ############################################
  #start change session
  wm = 60000
  tm = 120000
  invoke $cm/startEdit $wm $tm
  
  ############################################
  #make changes
  edit.com.bea:
  cd /Domain/$domain
  
  mb = run lookupServer $server
  
  sr = run createJDBCSystemResource $ds
  cd $sr
  
  res = get JDBCResource
  cd $res
  set Name $ds
  
  par = get JDBCConnectionPoolParams
  cd $par
  set MaxCapacity 25
  set TestConnectionsOnReserve true
  set TestTableName "SYSTABLES"
  
  cd $res
  par = get JDBCDataSourceParams
  cd $par
  run addJNDIName "ds."$ds
  
  cd $res
  par = get JDBCDriverParams
  cd $par
  set Url "jdbc:pointbase:server://localhost:9093/weblogic_eval"
  set DriverName "com.pointbase.jdbc.jdbcUniversalDriver"
  set Password weblogic
  
  pro = get Properties
  cd $pro
  run createProperty "user" "weblogic"
  
  keys Type Name
  cd /JDBCSystemResource/$ds
  run addTarget $mb
  
  
  ############################################
  #save and activate
  keys Type Name
  invoke $cm/save
  invoke $cm/activate $tm