public interface ConnectionManager
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CHAR |
static java.lang.String |
FLOAT |
static java.lang.String |
INT |
static java.lang.String |
LONGVARBINARY |
static java.lang.String |
LONGVARCHAR |
static java.lang.String |
NUMERIC |
static int |
TABLES_INCOMPATIBLE |
static int |
TABLES_NOT_EXIST |
static int |
TABLES_OK |
static java.lang.String |
TIMESTAMP |
static java.lang.String |
VARCHAR |
| Modifier and Type | Method and Description |
|---|---|
void |
createTables(java.io.InputStream in)
Creates tables in the database.
|
void |
createTables(java.io.InputStream in,
java.sql.Connection conn)
The same as
createTables(InputStream), except that queries are executed
over the passed connection. |
long |
getAbsoluteTimestamp()
Returns the current absolute timestamp (UTC offset) according the clock of the underlying DB server -
that is, a heuristic calculation of the result of calling System.currentTimeMillis() on the DB server
host.
|
java.sql.Timestamp |
getCalendricTimestamp()
Returns a
java.sql.Timestamp object, representing the current calendar time of the
underlying DB server. |
java.sql.Connection |
getConnection()
Returns SQL connection for the connection pool represented by this interafce.
|
com.prosyst.mprm.data.system.DBCatalogueInfo |
getDBCatalogEntry(java.lang.String dbName)
Returns DBCatalogInfo with the specified entry from system database table.
|
com.prosyst.mprm.data.system.DBCatalogueInfo |
getDBCatalogEntry(java.lang.String dbName,
java.sql.Connection connection)
See {link #getDBCatalogEntry(String)}.
|
DBMetaData |
getMetaData()
Returns object, analogous to java.sql.DatabaseMetaData, but only a limited subset of it.
|
java.sql.Connection |
getReadOnlyConnection()
Returns readOnly SQL connection.
|
int |
validateTables(java.io.InputStream in)
Checks the format of a database table.
|
int |
validateTables(java.io.InputStream in,
java.sql.Connection conn)
The same as
validateTables(InputStream), except that queries are executed
over the passed connection. |
void |
writeDBCatalogEntry(java.lang.String dbName,
java.lang.String version)
Writes DBCatalogueInfo entry in the system database table.
|
void |
writeDBCatalogEntry(java.lang.String dbName,
java.lang.String version,
java.sql.Connection connection)
Writes DBCatalogueInfo entry in the system database table.
|
static final int TABLES_OK
static final int TABLES_NOT_EXIST
static final int TABLES_INCOMPATIBLE
static final java.lang.String LONGVARBINARY
static final java.lang.String INT
static final java.lang.String VARCHAR
static final java.lang.String CHAR
static final java.lang.String LONGVARCHAR
static final java.lang.String NUMERIC
static final java.lang.String FLOAT
static final java.lang.String TIMESTAMP
java.sql.Connection getConnection()
throws java.sql.SQLException
java.sql.SQLException - if an error occures while connecting to the database server.java.sql.Connection getReadOnlyConnection()
throws java.sql.SQLException
java.sql.SQLException - if an error occures while connecting to the database server.com.prosyst.mprm.data.system.DBCatalogueInfo getDBCatalogEntry(java.lang.String dbName)
throws java.sql.SQLException
dbName - the name of a DBServicejava.sql.SQLExceptioncom.prosyst.mprm.data.system.DBCatalogueInfo getDBCatalogEntry(java.lang.String dbName,
java.sql.Connection connection)
throws java.sql.SQLException
null.connection - existing SQL connection, if null a connection is created internallydbName - the name of a DBServicejava.sql.SQLExceptionvoid writeDBCatalogEntry(java.lang.String dbName,
java.lang.String version)
throws java.sql.SQLException
dbName - the name of a DBServiceversion - the version of a DBServicejava.sql.SQLExceptionvoid writeDBCatalogEntry(java.lang.String dbName,
java.lang.String version,
java.sql.Connection connection)
throws java.sql.SQLException
dbName - the name of a DBServiceversion - the version of a DBServiceconnection - existing connection which will be used for writing the entry in the databasejava.sql.SQLExceptionvoid createTables(java.io.InputStream in)
throws java.sql.SQLException
in - the sequence of CREATE statements.java.sql.SQLExceptionvoid createTables(java.io.InputStream in,
java.sql.Connection conn)
throws java.sql.SQLException
createTables(InputStream), except that queries are executed
over the passed connection. Useful if a DB service has a transactional variant.in - create SQL scriptconn - connection to use ; if null, the method does exactly the same as createTables(InputStream)java.sql.SQLExceptionint validateTables(java.io.InputStream in)
throws java.sql.SQLException
in - a sequence of CREATE statements defining the structure of the tables.TABLES_OK - if the table exists and its format is correct
TABLES_NOT_EXIST - if the tables do not exist
TABLES_INCOMPATIBLE - if the tables exist but their format differs.java.sql.SQLExceptionint validateTables(java.io.InputStream in,
java.sql.Connection conn)
throws java.sql.SQLException
validateTables(InputStream), except that queries are executed
over the passed connection. Useful if a DB service has a transactional variant.in - create SQL scriptconn - connection to use ; if null, the method does exactly the same as validateTables(InputStream)validateTables(InputStream)java.sql.SQLExceptionjava.sql.Timestamp getCalendricTimestamp()
throws java.sql.SQLException
java.sql.Timestamp object, representing the current calendar time of the
underlying DB server. The timestamp returned represents the same calendar time on all mPRM hosts,
not depending on the host's time zone.
This method should be used by subsystems that treat times of different origin as calendrically
equivalent (5 o'clock on site 1 is the same as 5 o'clock on site 2, even if the sites are in
different time zones). The return value does not give equivalent results when treated as an absolute
timestamp - its conversion to absolute format depends on the time zone of the calling host.
Therefore, the results of invoking getTime() or a similar conversion on the
returned object do not produce equivalent results and the return value should not be used in
that way.
java.sql.SQLExceptiongetAbsoluteTimestamp()long getAbsoluteTimestamp()
throws java.sql.SQLException
This method should be used by subsystems that wish to support absolute time-keeping and want to avoid minor discrepancies in different backend host clocks. The method does not provide a solution for incorreclty set machine clocks - on the contrary, the correct results depend on the approximately correct settings of the clocks on calling backend host relative to the clock of the DB server.
The method will yield completely correct results in environments, where all interested mPRM hosts and the DB server are in the same time zone and with tolerable discrepancies in their local clock times (within half the time difference between the local time zone and the closer of its neighbours).
java.sql.SQLExceptionDBMetaData getMetaData()
Copyright © 2019 Bosch Software Innovations GmbH. All Rights Reserved.