Java JDBC Connection Create getPhoenixConnection()

Here you can find the source of getPhoenixConnection()

Description

get Phoenix Connection

License

Open Source License

Declaration

public static Connection getPhoenixConnection() throws Exception 

Method Source Code


//package com.java2s;
import java.sql.Connection;
import java.sql.DriverManager;

public class Main {
    private static String zkQuorum = System.getProperty("hbase.zookeeper.quorum");

    public static Connection getPhoenixConnection() throws Exception {
        Class.forName("com.salesforce.phoenix.jdbc.PhoenixDriver");
        String connectionURL = "jdbc:phoenix:" + zkQuorum;
        Connection r = DriverManager.getConnection(connectionURL);
        r.setAutoCommit(true);/*from  w  ww.j  a  v  a 2s .co  m*/
        return r;
    }
}

Related

  1. getConnections(String driver, String url, String user, String pwd)
  2. getConnectionWithTransaction(String dbUrl, String dbUser, String dbPassword)
  3. getDBConnection()
  4. getJdbcOdbcConnection()
  5. getNewConnection()
  6. getSourceConnection(final Hashtable env)
  7. getStatement(Map config)
  8. getTargetConnection()
  9. getTestDBConnection()