Java JDBC Hadoop Connection getConnection()

Here you can find the source of getConnection()

Description

get Connection

License

Apache License

Declaration

public synchronized static Connection getConnection() 

Method Source Code


//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public synchronized static Connection getConnection() {
        try {/* www  . ja v a 2  s. c  o  m*/
            Connection conn = DriverManager.getConnection("jdbc:hive://master.hadoop:10000/myhive", "", "");
            return conn;
        } catch (SQLException e) {
            e.printStackTrace();
        }

        return null;
    }
}

Related

  1. getHiveConnection()