Package dk.kosmisk.postgresql.it
Class PostgresITDataSource.DatabaseFromProperty
- java.lang.Object
-
- dk.kosmisk.postgresql.it.PostgresITDataSource.DatabaseFromProperty
-
- All Implemented Interfaces:
PostgresITDataSource.DatabaseLocation
- Enclosing class:
- PostgresITDataSource
public static class PostgresITDataSource.DatabaseFromProperty extends Object implements PostgresITDataSource.DatabaseLocation
Database location from System Property, with user/password from ${user.name}
-
-
Constructor Summary
Constructors Constructor Description DatabaseFromProperty(String databaseName)Convenience constructor for DatabaseFromProperty(String, String)DatabaseFromProperty(String databaseName, String portProperty)Look for database in properties
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringjdbcUrl(Properties props)Construct a jdbc url Locate a database, and fill out user/password If a database cannot be located then return null, and do not set any user/password values
-
-
-
Constructor Detail
-
DatabaseFromProperty
public DatabaseFromProperty(String databaseName, String portProperty)
Look for database in properties- Parameters:
databaseName- name of databaseportProperty- system property containing port
-
DatabaseFromProperty
public DatabaseFromProperty(String databaseName)
Convenience constructor for DatabaseFromProperty(String, String)Passes through the databaseName, and constructs a system property as given 'postgresql.${databaseName}.port'
This is the convention for matching ports and databases
- Parameters:
databaseName- name of database
-
-
Method Detail
-
jdbcUrl
public String jdbcUrl(Properties props)
Description copied from interface:PostgresITDataSource.DatabaseLocationConstruct a jdbc url Locate a database, and fill out user/password If a database cannot be located then return null, and do not set any user/password values- Specified by:
jdbcUrlin interfacePostgresITDataSource.DatabaseLocation- Parameters:
props- where user/password is set- Returns:
- jdbc url or null
-
-