Unverified Commit c0434f74 authored by Mohamed Boussaa's avatar Mohamed Boussaa Committed by GitHub
Browse files

Add tools to connect to HSQLDB CLI (#3784)

* Add tools to connect to HSQLDB CLI

* Apply reviews

* Add .bat file and adapt the java path

* Small typo: add -jar
parent 785bebee
@rem ##########################################################################
@rem
@rem A Simple Shell Command To access HSQLDB CLI and connect by default to scheduler DB
@rem If you would like to connect to another ProActive DB, please configure the sqltool.rc file before running the script
@rem
@rem ##########################################################################
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%..
@rem================================================
IF exist "%APP_HOME%/jre" (set JAVA_HOME="%APP_HOME%/jre")
@rem================================================
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
:execute
@rem Execute DB connection script
"%JAVA_EXE%" -jar sqltool-2.4.1.jar --rcFile=sqltool.rc scheduler
#!/usr/bin/env bash
##############################################################################
##
## A Simple Shell Command To access HSQLDB CLI and connect by default to scheduler DB
## If you would like to connect to another ProActive DB, please configure the sqltool.rc file before running the script
##
##############################################################################
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/.." >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
################################################################
# if local JVM exists redefine JAVA_HOME
if [ -d "$APP_HOME/jre" ]; then
JAVA_HOME=$APP_HOME/jre
if [ -d "$APP_HOME/jre/Contents/Home" ]; then
# macos
JAVA_HOME=$APP_HOME/jre/Contents/Home
fi
fi
################################################################
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
exec "$JAVACMD" -jar sqltool-2.4.1.jar --rcFile=sqltool.rc scheduler
urlid scheduler
url jdbc:hsqldb:hsql://localhost:9001/scheduler
username scheduler
password
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment