@echo off

set DIR_SQL=%~dp0\..
set DIR_LIB=%DIR_SQL%\lib
set DIR_CONFIG=%DIR_SQL%\config
set DIR_JDBC=..

set LIB_JDBC=
rem set LIB_JDBC=%DIR_LIB%\jconn2.jar
rem set LIB_JDBC=%LIB_JDBC%;%DIR_JDBC%\ojdbc14.jar
rem set LIB_JDBC=%LIB_JDBC%;%DIR_JDBC%\postgresql-8.2-506.jdbc3.jar
rem set LIB_JDBC=%LIB_JDBC%;%DIR_JDBC%\mysql-connector-java-5.1.5-bin.jar
rem set LIB_JDBC=%LIB_JDBC%;%DIR_JDBC%\hsqldb.jar

set CLASSPATH=%LIB_JDBC%
set CLASSPATH=%CLASSPATH%;%DIR_SQL%\lib\sqltool-5.3.0-SNAPSHOT.jar
set CLASSPATH=%CLASSPATH%;%DIR_SQL%;%DIR_CONFIG%

rem additional options here.
rem -Dsql.driver=sybase
rem -Dsql.editor=vi
rem -Dsql.less=more
rem -Dsql.encoding=EUC-JP
rem -Dsql.config=DbEnv.xml
rem -Dsql.logconfig=log4j.xml
rem -Dsql.debug=1

set CONFIG=-Dsql.config=%DIR_CONFIG%\DbEnv.xml

if x%1 == x goto NULL
set DRV=-Dsql.driver=%1
goto EXEC
:NULL

:EXEC
java %DRV% %CONFIG% -Dsql.editor=notepad -cp %CLASSPATH% jp.co.sds_corp.sqltool.SqlTool %*
