### ### get_DataSource.sh ### ### ### Calls get_DataSources.jacl ### ### Generates JACL source code for configuring JDBC Provider ### ### Take the output and plug it into get_DataSources.jacl ### ### Usage: ### get_DataSource.sh cellname nodename servername ### USAGE=" Usage: $0 -u username -p password -c cell -n node -s server " while getopts "u:p::c:n:s:l" opt; do case $opt in u ) xuser=$OPTARG ;; p ) xpasswd=$OPTARG ;; c ) xcell=$OPTARG ;; n ) xnode=$OPTARG ;; s ) xserver=$OPTARG ;; * ) echo $USAGE exit 1 ;; esac done if [ "$xserver" = "" ] then echo $USAGE exit 1 fi if [ "$xuser" = "" ] then echo $USAGE exit 1 fi if [ "$xpasswd" = "" ] then echo $USAGE exit 1 fi if [ "$xcell" = "" ] then echo $USAGE exit 1 fi if [ "$xnode" = "" ] then echo $USAGE exit 1 fi echo "### " echo "### set_DataSources.jacl " echo "### " echo "### " echo "### " echo "### " echo "### " echo " " echo "proc set_DataSource {cname nname sname} { " echo " " echo " " echo "### " echo "### set up globals " echo "### " echo " " echo "global AdminConfig " echo "global AdminControl " echo "global AdminApp " echo " " echo "set JDBCProviders [\$AdminConfig getid /Cell:\$cname/Node:\$nname/Server:\$sname/JDBCProvider:/] " echo " " echo "if {[llength \$JDBCProviders] == 0} { " echo " puts \"No JDBC Providers...returning \" " echo " return " echo "} " echo " " echo " foreach JDBCProvider \$JDBCProviders {" wsadmin.sh -username $xuser -password $xpasswd -f get_DataSources.jacl $xcell $xnode $xserver | \ grep -v WASX7209I | \ sed "s,}$,} \\\\," | \ sed "s,{},\"\"," | \ sed "/^\$AdminConfig create DataSource \$JDBCProvider { {classpath/,/^{xa true} }/d" | \ grep -v "^{provider" | \ grep -v "^{relationalResourceAdapter " echo "} " echo " " echo "\$AdminConfig save " echo " " echo "} " echo " " echo " " echo " " echo "### " echo "### Main " echo "### " echo " " echo " " echo "if { !(\$argc == 3) } { " echo " puts \"\" " echo " puts \"Usage: \" " echo " puts \" \" " echo " puts \"wsadmin.sh -username system -password password -f set_DataSources.jacl cellname nodename servername\" " echo " puts \"\" " echo " puts \"For example: \" " echo " puts \" \" " echo " puts \"wsadmin.sh -username was -password acme@ -f set_DataSources.jacl hostnameNetwork hostname ops_1_1\" " echo "} else { " echo " set xcell [lindex \$argv 0] " echo " set xnode [lindex \$argv 1] " echo " set xserver [lindex \$argv 2] " echo " set_DataSource \$xcell \$xnode \$xserver " echo "} "