H2 jdbc Connection refused: connect 90067-147

随声附和 提交于 2019-12-08 07:32:58

问题


I got a project to upgrade and it is using h2 DB with jdbc driver. During the build I have a systematic error on connection:

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)

I don't see why the connection is refused, the server is well started on the same URL, PORT and DB as the one requested.

The server is well started, but the error happen when I want to open the connection:

Connection connection = DriverManager.getConnection(DBURL, DBUSER, DBPWD + " " + DB_PWD);

Any idea about what can be the cause?

Update: This problem was not related to the firewalls but mainly to the server DB path.

来源:https://stackoverflow.com/questions/32906232/h2-jdbc-connection-refused-connect-90067-147

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!