home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
wsgatsam.zip
/
install
/
installJDBC.bat
< prev
next >
Wrap
DOS Batch File
|
2003-02-24
|
3KB
|
70 lines
@title Creating JDBC Provider - IBM WebServices Gateway
@rem parameters are 1=WebServices Gateway install directory (typically C:\WebSphere\WSGW)
@rem 2=node name
@rem 3=WebSphere directory (typically C:\WebSphere\AppServer)
@rem 4=DB2 install directory (e.g. C:\PROGRA~1\SQLLIB)
@if .%1==. goto invalidparams
@if .%2==. goto invalidparams
@if .%3==. goto invalidparams
@if .%4==. goto invalidparams
@rem Check parameter 1 is a valid directory.
@if EXIST %1 goto goodparam1
@echo The directory %1 specified for Gateway install directory does not exist.
@goto invalidparams
@rem Check parameter 3 is a valid directory.
:goodparam1
@if EXIST %3 goto goodparam2
@echo The directory %3 specified for WebSphere AppServer directory does not exist.
@goto invalidparams
@rem Check parameter 4 is a valid directory.
:goodparam2
@if EXIST %4 goto goodparam3
@echo The directory %4 specified for DB2 install directory does not exist.
@goto invalidparams
@rem Check parameter 4 points to the right place.
:goodparam3
@if EXIST %4\java\db2java.zip goto goodparams
@echo The file %4\java\db2java.zip does not exist.
@goto invalidparams
@rem Parameters are good.
:goodparams
@echo start Admin Server (will put out a message if already started)
net start "IBM WS AdminServer 4.0"
set NODENAME=%2
set WASDIR=%3
set DBZIPPATH=%4\java\db2java.zip
@echo Install WebServices Gateway JDBC driver
@echo If you have not previously installed the WebServices Gateway,
@echo you will get a message saying that the WebServices Gateway JDBC Driver Does not exist.
call %WASDIR%\bin\XMLConfig -adminNodeName %NODENAME% -import %1\install\wsgw_jdbc.xml -substitute "NODE_NAME=%NODENAME%;WAS_DIR=%WASDIR%;JDBC_CLASS=COM.ibm.db2.jdbc.DB2XADataSource;JNDI_NAME=jdbc/WSGWDB;JDBC_PATH=%DBZIPPATH%"
@if errorlevel 0 goto InstallWorked
rem (leq only works if there is not an environment variable called ERRORLEVEL)
@if %errorlevel% leq 0 goto InstallWorked
@echo.
@echo Warning: an error might have occurred during the installation of the WebServices Gateway.
@echo Please check the WSGWInstallJDBC.log file in the \logs subdirectory
@echo of the WebServices Gateway install directory.
:InstallWorked
@goto :eof
:invalidparams
@echo This command file should not be run standalone
@echo Parameters are 1=WebServices Gateway install directory (typically C:\WebSphere\WSGW)
@echo 2=node name
@echo 3=WebSphere directory (typically C:\WebSphere\AppServer)
@echo 4=DB2 install directory (e.g. C:\PROGRA~1\SQLLIB)