Java JDBC PostgreSQL Connection createConnection()

Here you can find the source of createConnection()

Description

create Connection

License

Open Source License

Declaration

private static Connection createConnection() throws SQLException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

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

import java.sql.SQLException;

public class Main {
    private static final String DB_CONNECTION_URL = "jdbc:postgresql://127.0.0.1:5432/SampleV2_test";
    private static final String DB_USERNAME = "SampleV2";
    private static final String DB_PASSWORD = "SampleV2";

    private static Connection createConnection() throws SQLException {
        return DriverManager.getConnection(DB_CONNECTION_URL, DB_USERNAME, DB_PASSWORD);
    }/*from www . ja v a 2 s.c  o  m*/
}

Related

  1. ClearDatabase()
  2. getConnection()
  3. getConnection()
  4. getDataFromTable(String tableName, String[] columns)
  5. getDBConnection()