Here you can find the source of getPostgresConnection()
public static Connection getPostgresConnection() 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 getPostgresConnection() throws SQLException { String url = "jdbc:postgresql://192.168.231.10:5432/flexims"; Properties props = new Properties(); props.setProperty("user", "flexims"); props.setProperty("password", "123456"); return DriverManager.getConnection(url, props); }//from www .j av a 2 s. c o m public static Connection getConnection() throws SQLException { return getDerbyUnitConnection(); } public static Connection getDerbyUnitConnection() throws SQLException { String url = "jdbc:derby:memory:flexims;create=true"; Properties props = new Properties(); props.setProperty("user", "flexims"); props.setProperty("password", "123456"); return DriverManager.getConnection(url, props); } }