package util.sqlparse.visitor.gauss.test;

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

public class TestJdbc {
   public static void main(String[] args) throws InterruptedException, SQLException, ClassNotFoundException {
      connectGreenplumJdbc120();
   }

   private static void connectGreenplumJdbc120() throws ClassNotFoundException, SQLException {
      Class.forName("org.postgresql.Driver");
      String url = "jdbc:postgresql://192.168.2.120:5432/test";
      Connection connection = DriverManager.getConnection(url, "Gaussadmin", "Gaussadmin");
      Statement statement = connection.createStatement();
      ResultSet resultSet = statement.executeQuery("SELECT * FROM public.table1");

      while(resultSet.next()) {
         System.out.println(resultSet.getString(1));
      }

   }
}
