我有一个要升级的项目,它正在使用带有jdbc驱动程序的h2 DB。在构建期间,我在连接时遇到系统错误:
Exception in thread "main" org.h2.jdbc.JdbcSQLException: Connection is broken: "Connection refused: connect" [90067-147]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:156)
at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:380)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:271)
at org.h2.engine.SessionRemote.createSession(SessionRemote.java:265)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:110)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:94)
at org.h2.Driver.connect(Driver.java:72)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
我不明白为什么连接被拒绝,服务器很好地启动了与请求的URL相同的URL,PORT和DB。
服务器启动良好,但是当我想打开连接时发生错误:
Connection connection = DriverManager.getConnection(DBURL, DBUSER, DBPWD + " " + DB_PWD);
关于可能是什么原因的任何想法?
更新:此问题与防火墙无关,但主要与服务器数据库路径有关。