@ThreadRestricted(value="holds this") public final class Database extends Object
Database.ConstructionContext
Modifier and Type | Class and Description |
---|---|
static class |
Database.ConstructionContext
A context for configuring a PostgreSQL database.
|
Modifier and Type | Field and Description |
---|---|
static int |
MAX_IDENTIFIER_LENGTH
Maximum length of an SQL identifier, for PostgreSQL (default build).
|
Constructor and Description |
---|
Database(Database.ConstructionContext cc)
Partially constructs a Database.
|
Modifier and Type | Method and Description |
---|---|
Connection |
connection()
Returns the database connection of this interface.
|
void |
ensureSchema(String name)
Ensures the specified schema exists in this database, creating it if necessary.
|
boolean |
equals(Object o)
Returns true iff o is a database configured with the same name, server name, port
and user.
|
int |
hashCode() |
void |
init(org.postgresql.ds.PGSimpleDataSource s)
Finishes constructing this Database.
|
void |
logAndClearWarnings()
Logs any warnings recorded in the connection, and clears them.
|
HashMap<String,PreparedStatement> |
statementCache()
A map of client-prepared statements for reuse with this database.
|
public static final int MAX_IDENTIFIER_LENGTH
public Database(Database.ConstructionContext cc)
@ThreadSafe public void init(org.postgresql.ds.PGSimpleDataSource s) throws SQLException
IllegalStateException
- if init was already called.SQLException
@Warning(value="thread restricted object") public Connection connection()
public void ensureSchema(String name) throws SQLException
SQLException
@ThreadSafe public void logAndClearWarnings()
public HashMap<String,PreparedStatement> statementCache()
@ThreadSafe public final boolean equals(Object o)
@ThreadSafe public final int hashCode()