greenplum.jar 官方驱动 JDBC
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"); w hile (rs.next()) { System.out.println(rs.getString(1)); } rs.close(); st.close(); } }
用户评论
Miss__ 2018-12-07 17:00:16
谢谢分享!!
cjq57710 2018-12-07 17:00:16
可以用,不错。
_Wayne_ 2018-12-07 17:00:16
很好的资源