1. 首页
  2. 移动开发
  3. JavaME
  4. greenplum.jar 官方JDBC驱动

greenplum.jar 官方JDBC驱动

上传者: 2018-12-09 14:48:37上传 ZIP文件 1.52MB 热度 339次
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"); wh ile (rs.next()) { System.out.println(rs.getString(1)); } rs.close(); st.close(); } }
用户评论
码姐姐匿名网友 2018-12-09 14:48:37

谢谢分享,试试先!