Use H2 Database to connect to any database
https://devrealm.org/use-h2-database-to-connect-to-any-database/
JDBC 다운로드 후
export H2DRIVERS="/home/............../postgresql-42.2.23.jar"
실행
nohup java -cp h2-1.4.200.jar org.h2.tools.Server -tcp -web -webAllowOthers -webPort 8082 > /dev/null &
옵션목록
java -cp h2-1.4.200.jar org.h2.tools.Server -?
Starts the H2 Console (web-) server, TCP, and PG server.
Usage: java org.h2.tools.Server <options>
When running without options, -tcp, -web, -browser and -pg are started.
Options are case sensitive. Supported options are:
[-help] or [-?] Print the list of options
[-web] Start the web server with the H2 Console
[-webAllowOthers] Allow other computers to connect - see below
[-webDaemon] Use a daemon thread
[-webPort <port>] The port (default: 8082)
[-webSSL] Use encrypted (HTTPS) connections
[-webAdminPassword] Password of DB Console administrator
[-browser] Start a browser connecting to the web server
[-tcp] Start the TCP server
[-tcpAllowOthers] Allow other computers to connect - see below
[-tcpDaemon] Use a daemon thread
[-tcpPort <port>] The port (default: 9092)
[-tcpSSL] Use encrypted (SSL) connections
[-tcpPassword <pwd>] The password for shutting down a TCP server
[-tcpShutdown "<url>"] Stop the TCP server; example: tcp://localhost
[-tcpShutdownForce] Do not wait until all connections are closed
[-pg] Start the PG server
[-pgAllowOthers] Allow other computers to connect - see below
[-pgDaemon] Use a daemon thread
[-pgPort <port>] The port (default: 5435)
[-properties "<dir>"] Server properties (default: ~, disable: null)
[-baseDir <dir>] The base directory for H2 databases (all servers)
[-ifExists] Only existing databases may be opened (all servers)
[-ifNotExists] Databases are created when accessed
[-trace] Print additional trace information (all servers)
[-key <from> <to>] Allows to map a database name to another (all servers)
The options -xAllowOthers are potentially risky.
For details, see Advanced Topics / Protection against Remote Access.
See also https://h2database.com/javadoc/org/h2/tools/Server.html
'DB > H2' 카테고리의 다른 글
H2 임베디드 데이터 베이스 (0) | 2019.09.13 |
---|
댓글