### 
### set_JDBCProvider.jacl 
### 
### 
### When refreshing this script 
### 
### 
### 
### We set up JDBC Providers with one word names 
### in order to avoid problems using getid later. 
### 
### I have been unable to run 
### 
###   $AdminConfig getid /Cell:$cname/Node:$nname/Server:$sname/JDBCProvider:Oracle JDBC Driver/ 
### 
### Get an error each time, even if I add quotes around name.  However... 
### 
###   $AdminConfig getid /Cell:$cname/Node:$nname/Server:$sname/JDBCProvider:Oracle_JDBC_Driver/ 
### 
### ...works fine. 
### 
### 
 
proc set_JDBCProvider {cname nname sname} { 
 
 
### 
### set up globals 
### 
 
global AdminConfig 
global AdminControl 
global AdminApp 
 
puts "Setting JDBCProvider for $cname $nname $sname" 
 
puts "Settings serverid..." 
set serverid [$AdminConfig getid /Cell:$cname/Node:$nname/Server:$sname/] 
 
if {[llength $serverid] == 0} { 
    puts "Serverid null - returning " 
    exit 
} 
 
 
 
### 
### Configure JDBCProviders 
### 
 
puts "Configuring providers..." 
 
 
################################################################## 
### The code below is derived from get_JDBCProvider.jacl 
### 
### If you use a variable for classpath, make sure variable 
### is defined under Environment | Manage WebSphere Variables 
### 

$AdminConfig create JDBCProvider $serverid { {classpath /usr/local/ops/config/lib/classes12.jar} \
{description "Oracle JDBC Driver (XA)"} \
{implementationClassName oracle.jdbc.xa.client.OracleXADataSource} \
{name "Oracle_JDBC_Driver_XA"} \
{nativepath {}} \
{xa true}} 

$AdminConfig create JDBCProvider $serverid { {classpath /usr/local/ops/config/lib/classes12.jar} \
{description "Oracle JDBC Driver"} \
{implementationClassName oracle.jdbc.pool.OracleConnectionPoolDataSource} \
{name "Oracle_JDBC_Driver"} \
{nativepath {}} \
{xa false}} 
   
   
###   
##################################################################   
      
$AdminConfig save      
   
   
### Synchronize nodes   
   
puts "Synchronizing nodes..."   
set Sync1 [$AdminControl completeObjectName type=NodeSync,node=$nname,*]   
set xstatus [$AdminControl invoke $Sync1 sync]   
   
if {$xstatus == "false"} {   
    puts "Unable to synchronize nodes..."   
}   
   
      
}      
      
      
      
###      
### Main      
###      
      
      
if { !($argc == 3) } {      
   puts ""      
   puts "Usage:  "      
   puts " "      
   puts "wsadmin.sh -username system -password password -f set_JDBCProvider.jacl cellname nodename servername "    
   puts ""      
   puts "For example:  "      
   puts " "      
   puts "wsadmin.sh -username was -password acme@ -f  set_JDBCProvider.jacl hostnameNetwork hostname ops_1_1 "    
} else {       
   set xcell        [lindex $argv 0]        
   set xnode        [lindex $argv 1]        
   set xserver      [lindex $argv 2]        
   set_JDBCProvider $xcell $xnode $xserver 
}      

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.