You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
646 B
25 lines
646 B
package dto; |
|
|
|
import org.json.JSONException; |
|
|
|
import java.sql.Connection; |
|
import java.sql.DriverManager; |
|
import java.sql.SQLException; |
|
|
|
import static constants.PSGQL.*; |
|
|
|
// @TODO Replace hard-coded credentials; make use of our secure db connection practice |
|
|
|
public class ConnectDB { |
|
|
|
public Connection connect() throws JSONException { |
|
try { |
|
Connection conn = DriverManager.getConnection(url, user, password); |
|
System.out.println("Connected to PostgreSQL server"); |
|
return conn; |
|
} catch (SQLException e) { |
|
System.out.println(e.getMessage()); |
|
} |
|
return null; |
|
} |
|
}
|
|
|