Package edu.suffolk.litlab.efsp.db
Class DatabaseCreator
java.lang.Object
edu.suffolk.litlab.efsp.db.DatabaseCreator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DataSourcemakeDataSource(String pgUrl, int pgPort, String pgDb, String pgUser, String pgPassword, int maxConnections, int waitForConnMillis) static DataSourcemakeDataSource(String pgFullUrl, String pgDb, String pgUser, String pgPassword, int maxConnections, int waitForConnMillis) Of the full jdbc form, with no db name: e.g.static ConnectionmakeSingleConnection(String pgDb, String pgFullUrl, String pgUser, String pgPassword)
-
Constructor Details
-
DatabaseCreator
public DatabaseCreator()
-
-
Method Details
-
makeDataSource
public static DataSource makeDataSource(String pgUrl, int pgPort, String pgDb, String pgUser, String pgPassword, int maxConnections, int waitForConnMillis) throws ClassNotFoundException, SQLException - Parameters:
pgUser- The user of the PostgreSQL databasepgPassword- The password for the above user- Throws:
ClassNotFoundExceptionSQLException
-
makeDataSource
public static DataSource makeDataSource(String pgFullUrl, String pgDb, String pgUser, String pgPassword, int maxConnections, int waitForConnMillis) throws ClassNotFoundException, SQLException Of the full jdbc form, with no db name: e.g. "jdcb:postgresql://localhost:9000"- Throws:
ClassNotFoundExceptionSQLException
-
makeSingleConnection
public static Connection makeSingleConnection(String pgDb, String pgFullUrl, String pgUser, String pgPassword) throws SQLException - Throws:
SQLException
-