home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wsgatsam.zip / install / installJDBC.bat < prev    next >
DOS Batch File  |  2003-02-24  |  3KB  |  70 lines

  1. @title Creating JDBC Provider - IBM WebServices Gateway
  2.  
  3. @rem parameters are 1=WebServices Gateway install directory (typically C:\WebSphere\WSGW)
  4. @rem                2=node name
  5. @rem                3=WebSphere directory (typically C:\WebSphere\AppServer)
  6. @rem                4=DB2 install directory (e.g. C:\PROGRA~1\SQLLIB) 
  7.  
  8. @if .%1==. goto invalidparams
  9. @if .%2==. goto invalidparams
  10. @if .%3==. goto invalidparams
  11. @if .%4==. goto invalidparams
  12.  
  13. @rem Check parameter 1 is a valid directory.
  14. @if EXIST %1 goto goodparam1
  15. @echo The directory %1 specified for Gateway install directory does not exist.
  16. @goto invalidparams
  17.  
  18. @rem Check parameter 3 is a valid directory.
  19. :goodparam1
  20. @if EXIST %3 goto goodparam2
  21. @echo The directory %3 specified for WebSphere AppServer directory does not exist.
  22. @goto invalidparams
  23.  
  24. @rem Check parameter 4 is a valid directory.
  25. :goodparam2
  26. @if EXIST %4 goto goodparam3
  27. @echo The directory %4 specified for DB2 install directory does not exist.
  28. @goto invalidparams
  29.  
  30. @rem Check parameter 4 points to the right place.
  31. :goodparam3
  32. @if EXIST %4\java\db2java.zip goto goodparams
  33. @echo The file %4\java\db2java.zip does not exist.
  34. @goto invalidparams
  35.  
  36. @rem Parameters are good.
  37. :goodparams
  38. @echo start Admin Server (will put out a message if already started)
  39. net start "IBM WS AdminServer 4.0"
  40.  
  41. set NODENAME=%2
  42. set WASDIR=%3
  43. set DBZIPPATH=%4\java\db2java.zip
  44.  
  45. @echo Install WebServices Gateway JDBC driver 
  46.  
  47. @echo  If you have not previously installed the WebServices Gateway,
  48. @echo  you will get a message saying that the WebServices Gateway JDBC Driver Does not exist. 
  49.  
  50. 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%"
  51. @if errorlevel 0 goto InstallWorked
  52. rem (leq only works if there is not an environment variable called ERRORLEVEL)
  53. @if %errorlevel% leq 0 goto InstallWorked
  54.  
  55. @echo.
  56. @echo Warning: an error might have occurred during the installation of the WebServices Gateway.
  57. @echo Please check the WSGWInstallJDBC.log file in the \logs subdirectory 
  58. @echo of the WebServices Gateway install directory.
  59.  
  60. :InstallWorked
  61.  
  62. @goto :eof
  63.  
  64. :invalidparams
  65. @echo This command file should not be run standalone
  66. @echo Parameters are 1=WebServices Gateway install directory (typically C:\WebSphere\WSGW)
  67. @echo                2=node name
  68. @echo                3=WebSphere directory (typically C:\WebSphere\AppServer)
  69. @echo                4=DB2 install directory (e.g. C:\PROGRA~1\SQLLIB) 
  70.