import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class Greenplum {
public static void main(String args[]) throws Exception{
Class.forName("com.pivotal.jdbc.GreenplumDriver");
Connection db = DriverManager.getConnection("jdbc:pivotal:greenplum://192.168.139.128:5432;DatabaseName=postgres", "gpadmin", "gpadmin");
Statement st = db.createStatement();
ResultSet rs = st.executeQuery("SELECT * FROM test01 limit 100");
while (rs.next()) {
System.out.println(rs.getString(1));
}
rs.close();
st.close();
}
}
1