Here you can find the source of createConnection()
private static Connection createConnection() throws SQLException
//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*/ }