H2 Database Scripts - Gists · GitHub

Skip to content Search Gists Search Gists All gists Back to GitHub Sign in Sign up Sign in Sign up Dismiss alert {{ message }}

Instantly share code, notes, and snippets.

@tachesimazzoca tachesimazzoca/README.md Last active October 28, 2024 17:18 Show Gist options
  • Star (4) You must be signed in to star a gist
  • Fork (3) You must be signed in to fork a gist
  • Embed Select an option
    • Embed Embed this gist in your website.
    • Share Copy sharable link for this gist.
    • Clone via HTTPS Clone using the web URL.

    No results found

    Learn more about clone URLs Clone this repository at <script src="https://gist.github.com/tachesimazzoca/e0f50e7f26a201b30a5e.js"></script>
  • Save tachesimazzoca/e0f50e7f26a201b30a5e to your computer and use it in GitHub Desktop.
Code Revisions 3 Stars 4 Forks 3 Embed Select an option
  • Embed Embed this gist in your website.
  • Share Copy sharable link for this gist.
  • Clone via HTTPS Clone using the web URL.

No results found

Learn more about clone URLs Clone this repository at <script src="https://gist.github.com/tachesimazzoca/e0f50e7f26a201b30a5e.js"></script> Save tachesimazzoca/e0f50e7f26a201b30a5e to your computer and use it in GitHub Desktop. Download ZIP H2 Database Scripts Raw README.md H2 Database Scripts

Make a directory, like ~/.h2, and put the following files in it.

  • ~/.h2/lib/h2-*.jar: Get the latest h2-*.jar file from http://www.h2database.com/.
  • ~/.h2/bin/h2-server: org.h2.tools.Server
  • ~/.h2/bin/h2-shell: org.h2.tools.Shell
  • ~/.h2/db/ : H2 data files *.mv.db

You may add the path ~/.h2/bin to your env $PATH.

$ vi ~/.bash_profile ... PATH=$HOME/.h2/bin:$PATH export PATH ...

To start or stop H2 Database server, run h2-server (start|stop).

# Start TCP server in background $ h2-server start TCP server running at tcp://x.x.x.x:9092 (only local connections) ... # Stop TCP server "tcp://localhost" $ h2-server stop

h2-shell is just a wrapper script for org.h2.tools.Shell. You can use the same command-line options.

$ h2-shell -help ... $ h2-shell -url "jdbc:h2:tcp://localhost/~/.h2/db/test" -user "sa" ... Raw h2-server This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters
#!/bin/sh
cd `dirname ${0}`/..
case $1 in
help)
java -cp lib/h2-*.jar org.h2.tools.Server -?
;;
start)
java -cp lib/h2-*.jar org.h2.tools.Server -tcp -baseDir db &
;;
stop)
java -cp lib/h2-*.jar org.h2.tools.Server -tcpShutdown "tcp://localhost"
;;
*)
echo "Usage ${0} (help|start|stop)"
;;
esac
Raw h2-shell This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters
#!/bin/sh
cd `dirname ${0}`/..
java -cp lib/h2-*.jar org.h2.tools.Shell "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment You can’t perform that action at this time.

Từ khóa » H2/bin