h2-database 安装部署学习

1,下载jar 包

Archive Downloads

进入到下载的包的位置:

cd E:\IDE\Java\jre\lib

2,参考以下说明进行数据库创建:

Tutorial

执行如下 可以进行创建默认的数据库 设置用户密码

E:\IDE\Java\jre\lib> java -cp h2-2.2.224.jar org.h2.tools.Shell

Welcome to H2 Shell 2.2.224 (2023-09-17)

Exit with Ctrl+C

[Enter] jdbc:h2:~/test

URL jdbc:h2:./test

[Enter] org.h2.Driver

Driver

[Enter] sa

User

Password

Type the same password again to confirm database creation.

Password

Connected

Commands are case insensitive; SQL statements end with ';'

help or ? Display this help

list Toggle result list / stack trace mode

maxwidth Set maximum column width (default is 100)

autocommit Enable or disable autocommit

history Show the last 20 statements

quit or exit Close the connection and exit

sql> list

Result list mode is now on

sql> help

Commands are case insensitive; SQL statements end with ';'

help or ? Display this help

list Toggle result list / stack trace mode

maxwidth Set maximum column width (default is 100)

autocommit Enable or disable autocommit

history Show the last 20 statements

quit or exit Close the connection and exit

sql>

3,启动H2服务

E:\IDE\Java\jre\lib>java -jar h2-2.2.224.jar

@java -cp "h2.jar;%H2DRIVERS%;%CLASSPATH%" org.h2.tools.Console %*

@if errorlevel 1 pause

4,在网页客户端上面进行数据库操作;

弹出web页面进行创建

http://本地IP:8082/login.jsp?jsessionid=5b3d796fc6c67ea53da64d2580b38c05

显示如下(JDBC URL要要上面设置的保持一致)

h2-database 安装部署学习_第1张图片

5,登录成功后操作页面如下 :

h2-database 安装部署学习_第2张图片

你可能感兴趣的:(数据库,学习)