Here you can find the source of getConnection()
public static Connection getConnection() throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Properties; public class Main { public static Connection getConnection() throws SQLException { String url = "jdbc:postgresql://localhost/marketplace"; Properties props = new Properties(); props.setProperty("user", "marketplace"); props.setProperty("password", "test"); return DriverManager.getConnection(url, props); }//from www. j a v a2s.co m }