JDBC driver uses default port (5433) even when different port is specified

I've configured a DB with a port that differs from the default one (58001 instead of 5433). I can connect to the DB just fine with 'vsql -p 58001'. However, if I try to hook up to the DB using the JDBC driver ("jdbc:vertica://localhost:58001/mydb"), the connection fails, since it tries to use the default port (5433) anyway: ----- Caused by: java.sql.SQLException: [Vertica][VJDBC](100176) Failed to connect to host localhost on port 5433. Reason: Connection refused at com.vertica.io.ProtocolStream.(Unknown Source) at com.vertica.core.VConnection.connect(Unknown Source) at com.vertica.jdbc.BaseConnectionFactory.doConnect(Unknown Source) at com.vertica.jdbc.AbstractDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(DriverManager.java:579) at java.sql.DriverManager.getConnection(DriverManager.java:221) ----- I can confirm that I am not sending 5433 as the port when setting up the connection, so perhaps the JDBC driver doesn't check the port I give it, and always uses the default? I'm using the Vertica community edition, v6.1.2-0 on a SuSE machine. Thanks for your help.


  • Options
    Is there any update on this? I'd like to run a few different databases, but since I rely on the JDBC driver, I'm currently limited to one. Thanks.
  • Options
    Hi Ben, I don't think that this is a jdbc driver issue. I reconfigured my database to put it on port 5434, and I was able to connect to it using DBeaver with the jdbc driver and port 5434. I then reconfigured the database on port 58001 and found that DBeaver was trying to connect on port 5433. When I changed the default port for the jdbc driver to 58001, I saw that DBeaver changed the default jdbc connection string to use port 5800. So if you are able to use a 4-digit port number, I suspect this will work for you. Keep in mind that running multiple simultaneous databases is an unsupported configuration. If you do this, be sure to lower the memory available to each database by changing the resource pool settings so that you don't end up swapping. --Sharon

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file