Help Center> GeminiDB> GeminiDB Cassandra API> FAQs> Database Connection> What Can I Do If an Error Occurs When I Use Java Driver and a Mapped IP Address to Connect to a Database?
Updated on 2023-11-21 GMT+08:00

What Can I Do If an Error Occurs When I Use Java Driver and a Mapped IP Address to Connect to a Database?

Symptom

When you use Java Driver to connect to a GeminiDB Cassandra instance, a session was established using the mapped IP address, rather than the database private IP address, over port 8635. However, an error was found in the connection log, and connection information of port 9042 was displayed.

Figure 1 Log information

Possible Cause

Java Driver was not used correctly, as shown in Figure 2. Do not use addContactPointsWitPorts when using Java Driver and do not map each IP address.

Figure 2 Incorrect usage of the Java Driver

Solution

Use the private IP address provided by the GeminiDB Cassandra database and change the port to port 8635.

The following figure shows the IP address and port.