h2数据库
2020-11-07 本文已影响0人
宋song一
1. java 操作
添加依赖:
testCompile group: 'com.h2database', name: 'h2', version: '1.4.197'
- 嵌入式连接
Connection conn = DriverManager.getConnection("jdbc:h2:D:/aa/test", "sa", "");
- 远程连接
Connection conn = DriverManager.
getConnection("jdbc:h2:tcp://localhost/D:/aa/test", "sa", "");
- 内存数据库
Connection conn = DriverManager.
getConnection("jdbc:h2:tcp://localhost/mem:test2", "sa", "");