Embedded嵌入式
jdbc:h2:file:<databaseName>
jdbc:h2:~/javacc,windows下則會在C:UsersAdministrator下建立文件javacc.mv.db,linux則當前用戶目錄下面
jdbc:h2:/data/test (linux only) linux下則會在/data下建立文件test.mv.db
jdbc:h2:./test 在當前目錄建立test.mv.db,IDE裏面就是當前項目目錄下面
jdbc:h2:file:C:/data/sample (Windows only)在C盤下面data目錄下建立文件sample.mv.dbjava
In-Memory 內存數據庫
jdbc:h2:mem:<databaseName>
jdbc:h2:mem:test multiple connections in one process 內存數據庫被命名
jdbc:h2:mem: unnamed private; one connection 內存數據庫私有
Server Mode 使用TCP/IP的服務器模式(遠程鏈接)
jdbc:h2:tcp://<server>[:<port>]/[<path>]<databaseName>
jdbc:h2:tcp://localhost/~/test user home dir
jdbc:h2:tcp://localhost//data/test absolute dirlinux
用戶名和密碼
jdbc:h2:<url>;USER=<username>數據庫
鏈接字符串參數
DB_CLOSE_DELAY:要求最後一個正在鏈接的鏈接斷開後,不要關閉數據庫windows