jdbc连接greenplum

使用jdbc连接greenplum

下载jdbc

http://download.csdn.net/detail/whf_0000/9709879

我很久没有登录csdn了,发现csdn把我的资源涨到了30积分,不说想说啥了,感觉商业跑偏了。

提供了maven的地址

http://nexus.saas.hand-china.com/content/repositories/rdc/com/pivotal/greenplum-jdbc/5.1.4/greenplum-jdbc-5.1.4.jar



    com.pivotal
    greenplum-jdbc
    5.1.4

 

package aaaa;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

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

}

 

 

 

 

 

你可能感兴趣的:(GreenPlum,greenplum)