VGet: "Failed to get a connection to the cluster".
I've installed the Vertica 7 VM image and I'm trying to use the new key/value feature. This is the program that I'm trying to run:
import java.sql.*;import com.vertica.jdbc.kv.*;
public class verticaKV2 {
public static void main(String[] args) {
com.vertica.jdbc.DataSource jdbcSettings
= new com.vertica.jdbc.DataSource();
jdbcSettings.setDatabase("VMART");
jdbcSettings.setHost("192.168.204.140");
jdbcSettings.setUserID("dbadmin");
jdbcSettings.setPassword("password");
jdbcSettings.setEnableRoutableQueries(true);
jdbcSettings.setFailOnMultiNodePlans(false);
jdbcSettings.setPort((short)5433);
VerticaRoutableConnection conn;
try {
conn = (VerticaRoutableConnection)
jdbcSettings.getConnection();
System.out.println("Connected.");
VGet get = conn.prepareGet("public", "customer_dimension");
get.addPredicate("customer_key", 5);
ResultSet rs = get.execute();
rs.next();
System.out.println("ID: " +
rs.getString("customer_key"));
System.out.println("Username: "
+ rs.getString("customer_name"));
System.out.println("Closing Connection.");
conn.close();
} catch (SQLException e) {
System.out.println("Error! Stacktrace:");
e.printStackTrace();
}
}
}
I'm getting an exception in the VGet get = conn.prepareGet("public", "customer_dimension"); line: "Failed to get a connection to the cluster".
What might be the cause? I'm using the tables that are coming in the example database and I registered the copy with a community edition license.
thanks,
Santiago
import java.sql.*;import com.vertica.jdbc.kv.*;
public class verticaKV2 {
public static void main(String[] args) {
com.vertica.jdbc.DataSource jdbcSettings
= new com.vertica.jdbc.DataSource();
jdbcSettings.setDatabase("VMART");
jdbcSettings.setHost("192.168.204.140");
jdbcSettings.setUserID("dbadmin");
jdbcSettings.setPassword("password");
jdbcSettings.setEnableRoutableQueries(true);
jdbcSettings.setFailOnMultiNodePlans(false);
jdbcSettings.setPort((short)5433);
VerticaRoutableConnection conn;
try {
conn = (VerticaRoutableConnection)
jdbcSettings.getConnection();
System.out.println("Connected.");
VGet get = conn.prepareGet("public", "customer_dimension");
get.addPredicate("customer_key", 5);
ResultSet rs = get.execute();
rs.next();
System.out.println("ID: " +
rs.getString("customer_key"));
System.out.println("Username: "
+ rs.getString("customer_name"));
System.out.println("Closing Connection.");
conn.close();
} catch (SQLException e) {
System.out.println("Error! Stacktrace:");
e.printStackTrace();
}
}
}
I'm getting an exception in the VGet get = conn.prepareGet("public", "customer_dimension"); line: "Failed to get a connection to the cluster".
What might be the cause? I'm using the tables that are coming in the example database and I registered the copy with a community edition license.
thanks,
Santiago
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.