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.ShellWelcome to H2 Shell 2.2.224 (2023-09-17)Exit with Ctrl+C[Enter] jdbc:h2:~/testURL jdbc:h2:./test[Enter] org.h2.DriverDriver[Enter] saUserPasswordType the same password again to confirm database creation.PasswordConnectedCommands are case insensitive; SQL statements end with ';'help or ? Display this helplist Toggle result list / stack trace modemaxwidth Set maximum column width (default is 100)autocommit Enable or disable autocommithistory Show the last 20 statementsquit or exit Close the connection and exitsql> listResult list mode is now onsql> helpCommands are case insensitive; SQL statements end with ';'help or ? Display this helplist Toggle result list / stack trace modemaxwidth Set maximum column width (default is 100)autocommit Enable or disable autocommithistory Show the last 20 statementsquit or exit Close the connection and exitsql>
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要要上面设置的保持一致)
5,登录成功后操作页面如下 :