Intellij idea 无法连接到Intellij中的h2数据库

Intellij idea 无法连接到Intellij中的h2数据库,intellij-idea,h2,Intellij Idea,H2,我试图在Intellij IDEA中学习本教程,但当我尝试连接到h2数据库时,控制台提示我一个错误: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost:9092" java.net.ConnectException: Connection refused: connect. 我需要做什么才能建立连接 提前谢谢 问题在于url,它需要指向您的应用程序

我试图在Intellij IDEA中学习本教程,但当我尝试连接到h2数据库时,控制台提示我一个错误:

 Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost:9092" 
        java.net.ConnectException: Connection refused: connect.
我需要做什么才能建立连接

提前谢谢


问题在于url,它需要指向您的应用程序的路径:
jdbc:h2:文件:C:\Users\romul\IdeaProjects\raspberryAwards;MV_存储=假;AUTO_SERVER=TRUE

注意:您的url使用tcp连接到数据库。这意味着H2数据库应该在9092端口上的本地主机上启动并运行。或者使用本教程所述的
文件
连接协议类型。