public abstract class DatabaseAccess
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DatabaseAccess.DatabaseType |
Modifier and Type | Field and Description |
---|---|
protected javax.servlet.ServletContext |
ctx |
private org.apache.commons.logging.Log |
log |
Modifier | Constructor and Description |
---|---|
protected |
DatabaseAccess(javax.servlet.ServletContext ctx) |
Modifier and Type | Method and Description |
---|---|
abstract double |
applyBounds(double value) |
static DatabaseAccess |
createDatabaseAccess(javax.servlet.ServletContext ctx) |
void |
doInConnection(com.serotonin.db.spring.ConnectionCallbackVoid callback) |
abstract void |
executeCompress(com.serotonin.db.spring.ExtendedJdbcTemplate ejt) |
static DatabaseAccess |
getDatabaseAccess() |
java.lang.String |
getDatabasePassword(java.lang.String propertyPrefix) |
abstract java.io.File |
getDataDirectory() |
abstract javax.sql.DataSource |
getDataSource() |
abstract DatabaseAccess.DatabaseType |
getType() |
void |
initialize() |
protected abstract void |
initializeImpl(java.lang.String propertyPrefix) |
protected abstract void |
initializeImpl(java.lang.String propertyPrefix,
java.lang.String dataSourceName) |
protected abstract boolean |
newDatabaseCheck(com.serotonin.db.spring.ExtendedJdbcTemplate ejt) |
protected void |
postInitialize(com.serotonin.db.spring.ExtendedJdbcTemplate ejt) |
java.sql.PreparedStatement |
prepareStatement(java.sql.Connection connection,
java.lang.String sql,
java.lang.String generatedKey)
Prepares the statement to insert operation that returning the
auto-generated key from the inserted row
|
abstract void |
runScript(java.lang.String[] script,
java.io.OutputStream out) |
abstract void |
terminate() |
private final org.apache.commons.logging.Log log
protected final javax.servlet.ServletContext ctx
public static DatabaseAccess createDatabaseAccess(javax.servlet.ServletContext ctx)
public static DatabaseAccess getDatabaseAccess()
public void initialize()
public abstract DatabaseAccess.DatabaseType getType()
public abstract void terminate()
public abstract javax.sql.DataSource getDataSource()
public abstract double applyBounds(double value)
public abstract java.io.File getDataDirectory()
public abstract void executeCompress(com.serotonin.db.spring.ExtendedJdbcTemplate ejt)
protected abstract void initializeImpl(java.lang.String propertyPrefix)
protected abstract void initializeImpl(java.lang.String propertyPrefix, java.lang.String dataSourceName)
protected void postInitialize(com.serotonin.db.spring.ExtendedJdbcTemplate ejt)
protected abstract boolean newDatabaseCheck(com.serotonin.db.spring.ExtendedJdbcTemplate ejt)
public abstract void runScript(java.lang.String[] script, java.io.OutputStream out) throws java.lang.Exception
java.lang.Exception
public void doInConnection(com.serotonin.db.spring.ConnectionCallbackVoid callback)
public java.lang.String getDatabasePassword(java.lang.String propertyPrefix)
public java.sql.PreparedStatement prepareStatement(java.sql.Connection connection, java.lang.String sql, java.lang.String generatedKey) throws java.sql.SQLException
sql
- an SQL statement that may contain one or more '?' IN parameter
placeholdersgeneratedKey
- name of the generated column that should be returned from the
inserted row or rowsPreparedStatement
object, containing the
pre-compiled statement, that is capable of returning the
auto-generated key designated by the generated column name.java.sql.SQLException