call setenv.bat

:: This script loads all data into the database based on the given scale factor.
:: Pass the orders_injection_rate as an argument. If not given, defaults to 1

:: directory /tmp is necessary in root directory of drive

@echo off

set SCALE=%1
GOTO :ENV

:ENV
::This shouldn't need to be modified
set LOAD_PKG=org.spec.jappserver.load

IF .%APPSSERVER%.==".." Goto  setENV
echo SPECjAppServer Home is %JAS_HOME%
echo Appsserver is %APPSSERVER%
echo ENVFILE is %ENVFILE%
echo SCALE is %SCALE%

set JDBC_CLASSPATH=c:\sqllib\java\db2java.zip

set CLASSPATH=%JAS_HOME%\changes;%JDBC_CLASSPATH%;%JAS_HOME%\jars\load.jar;D:\WebSphere_s0245.03\AppServer\lib\j2ee.jar

echo Loading Corp Database...
%JAVA_HOME%\jre\bin\java -Dspecjappserver.home=%JAS_HOME% %LOAD_PKG%.LoadCorp %SCALE% 

echo Loading Orders Database...
%JAVA_HOME%\jre\bin\java -Dspecjappserver.home=%JAS_HOME% %LOAD_PKG%.LoadOrds %SCALE%

echo Loading Manufacturing Database...
%JAVA_HOME%\jre\bin\java -Dspecjappserver.home=%JAS_HOME% %LOAD_PKG%.LoadMfg %SCALE%

echo Loading Supplier Database...
%JAVA_HOME%\jre\bin\java -Dspecjappserver.home=%JAS_HOME% %LOAD_PKG%.LoadSupp %SCALE%

echo Loading Discount Rules...
%JAVA_HOME%\jre\bin\java -Dspecjappserver.home=%JAS_HOME% %LOAD_PKG%.LoadRules discount %JAS_HOME%\schema\discount.rules
Goto Done

:setEnv
echo Please update and run setEnv.bat in the bin directory before running this command

:Done
