@echo off
rem  (C) COPYRIGHT International Business Machines Corp. 1999
rem  All Rights Reserved.
rem
rem  US Government Users Restricted Rights - Use, duplication or
rem  disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

rem Batch file to bind a Java embedded SQL (SQLJ) program.
rem Usage: embprep <prog_name> [ <db_name> [ <userid> <password> ]]

rem Bind the package to the database.
if "%1" == "" goto error
if "%2" == "" goto case1
if "%3" == "" goto case2
if "%4" == "" goto error
goto case3
:case1
   db2profc -url=jdbc:db2:sample -prepoptions="package using %1" %1_SJProfile0 
   goto continue
:case2
   db2profc -url=jdbc:db2:%2 -prepoptions="package using %1" %1_SJProfile0
   goto continue
:case3
   db2profc -url=jdbc:db2:%2 -user=%3 -password=%4 -prepoptions="package using %1" %1_SJProfile0
   goto continue
:continue

goto exit

:error
echo Usage: embprep prog_name [ db_name [ userid password ]]

:exit

@echo on