Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- spring.datasource.url=jdbc:h2:mem:dbname
- spring.datasource.driverClassName=org.h2.Driver
- spring.datasource.username=sa
- spring.datasource.password=
- spring.jpa.hibernate.ddl-auto=create
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <version>1.4.193</version>
- </dependency>
- import org.h2.tools.Server;
- ...
- // start the TCP Server
- server = Server.createTcpServer("-tcpAllowOthers").start();
- ...
- // stop the TCP Server
- server.stop();
- Usage: java org.h2.tools.Server
- 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 ] The port (default: 8082)
- [-webSSL] Use encrypted (HTTPS) connections
- [-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 ] The port (default: 9092)
- [-tcpSSL] Use encrypted (SSL) connections
- [-tcpPassword ] The password for shutting down a TCP server
- [-tcpShutdown ""] 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 ] The port (default: 5435)
- [-properties ""] Server properties (default: ~, disable: null)
- [-baseDir ] The base directory for H2 databases (all servers)
- [-ifExists] Only existing databases may be opened (all servers)
- [-trace] Print additional trace information (all servers)
- The options -xAllowOthers are potentially risky.
- For details, see Advanced Topics / Protection against Remote Access.
- See also http://h2database.com/javadoc/org/h2/tools/Server.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement