I recently started exploring GridDB Cloud, and I want to connect to my instance from a Java application running on a different machine. I've followed the GridDB Cloud Quick Start Guide and performed the following steps:
Whitelisted my IP on the GridDB Cloud portal.
Created a database user with the necessary credentials.
Checked my database URL, which follows this pattern:
griddb://<host>:<port>/defaultCluster
- Used the Java GridDB Client to attempt a connection:
import com.toshiba.mwcloud.gs.*;
public class GridDBCloudTest {
public static void main(String[] args) {
try {
Properties properties = new Properties();
properties.setProperty("host", "<my-cloud-host>");
properties.setProperty("port", "10001");
properties.setProperty("clusterName", "defaultCluster");
properties.setProperty("user", "<my-user>");
properties.setProperty("password", "<my-password>");
GridStoreFactory factory = GridStoreFactory.getInstance();
GridStore store = factory.getGridStore(properties);
System.out.println("Connected successfully!");
} catch (Exception e) {
e.printStackTrace();
}
}
}
Issue:
When running the Java application, I get the following error:
com.toshiba.mwcloud.gs.GSException: Failed to connect to GridDB Caused by: java.UnknownHostException:
What I've tried:
- Double-checked that my IP is whitelisted on the GridDB Cloud settings.
- Verified that the database user and password are correct.
- Ensured that port 10001 is open on my network.
- Tried pinging the GridDB Cloud host, but got no response.
Questions:
- Is there a different connection string format I should use for GridDB Cloud?
- Do I need to configure additional firewall rules beyond IP whitelisting?
- Is there a specific Java client version required for GridDB Cloud?