连接方式 | 连接 URL |
嵌入式(本地)连接
[Embedded (local) connection)]
| jdbc:h2:[file:][]
jdbc:h2:~/test
jdbc:h2:file:/data/sample
jdbc:h2:file:C:/data/sample (Windows only)
|
内存模式(私有的)
[In-memory (private)]
| In-memory (private) |
内存模式(命名的)
[In-memory (named)]
| jdbc:h2:mem:
jdbc:h2:mem:test_mem
|
服务器模式(远程连接) 使用 TCP/IP
[Server mode (remote connections) using TCP/IP]
| jdbc:h2:tcp://[:]/[]
jdbc:h2:tcp://localhost/~/test
jdbc:h2:tcp://dbserv:8084/~/sample
jdbc:h2:tcp://localhost/mem:test
|
服务器模式(远程连接) 使用 TLS
[Server mode (remote connections) using TLS]
| jdbc:h2:ssl://[:]/[]
jdbc:h2:ssl://localhost:8085/~/sample;
|
使用加密文件
[Using encrypted files]
| jdbc:h2:;CIPHER=AES
jdbc:h2:ssl://localhost/~/test;CIPHER=AES
jdbc:h2:file:~/secure;CIPHER=AES
|