Package

Source Code of PgTest

import org.adbcj.Connection;
import org.adbcj.ConnectionManager;
import org.adbcj.ConnectionManagerProvider;
import org.adbcj.DbException;
import org.adbcj.ResultSet;
import org.adbcj.Row;

public class PgTest {

  /**
   * @param args
   * @throws InterruptedException
   * @throws DbException
   */
  public static void main(String[] args) throws DbException, InterruptedException {
    ConnectionManager cm = ConnectionManagerProvider.createConnectionManager("adbcj:postgresql-mina://localhost/adbcjtck", "adbcjtck", "adbcjtck");
    Connection connection = cm.connect().get();
 
    final ResultSet rs = connection.executeQuery("SELECT * FROM large").get();
    for (Row row : rs) {
      System.out.println(row.get(0) + " " + row.get(1));
    }
    cm.close(true).get();
  }

}
TOP

Related Classes of PgTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.