public abstract class DatabaseConnection extends SimpleManipulator implements ConnectionClosedListener, SimulationListener
SimpleDataSource.NameEditorData
DataSource.Writable
Modifier and Type | Field and Description |
---|---|
static boolean |
alwaysCloseConnection
This will be set to true if an IllegalMonitorStateException is thrown when dealing with the connection.
|
static int |
debugLevel
The debug level for this bean.
|
static int |
HSQLDB
The connection is to HSQLDB.
|
java.text.DateFormat |
logDateFormat
used for all the debugLevel/consoleReport logging
|
static int |
MYSQL
The connection is to MYSQL.
|
static int |
ORACLE
The connection is to ORACLE.
|
static int |
OTHER
The connection is to a database we don't have an interest in.
|
static int |
POSTGRES
The connection is to SQLITE.
|
static int |
SQLITE
The connection is to SQLITE.
|
cvsRev
UPDATE_DISPLAYED_VALUE, VALUE_INPUT
customTimer, EXPORT_READ_ONLY, EXPORT_READ_WRITE, NO_EXPORT, requiresSyncWrite, sharedTimer, syncWriteTimeout, timebase
autoSuspend, AUTOSUSPEND_DEFAULT, AUTOSUSPEND_NEVER, AUTOSUSPEND_NO_LISTENERS, AUTOSUSPEND_NO_LISTENERS_AND_NO_SOURCES, colorHi, colorHiHi, colorLo, colorLoLo, colorNormal, connectors, consoleLogger, currentColor, currentValue, DEFAULT_AUTOSUSPEND, dontConnect, gwtLog, hardSuspended, popupLogger, PRIMARYOUTPORTNAME, sendColors, stopped, suspended, timedPopupLogger, traceLogger, valueHi, valueHiHi, valueLo, valueLoLo
cvsRev
Constructor and Description |
---|
DatabaseConnection() |
Modifier and Type | Method and Description |
---|---|
void |
connectionClosed(ConnectionClosedEvent cce)
This method is called by the connection pool when a (the?) connection to the database is closed.
|
java.lang.String |
eventInfo(ValueChangedEvent e) |
java.lang.String |
getConnectionName() |
boolean |
getConsoleReport()
gets whether or not a console report is desired.
|
int |
getDataBaseType()
This method will return one of the defined constants for the connection
type.
|
java.lang.String |
getDateColumnName() |
java.lang.String |
getTableName()
Returns the name of the table.
|
boolean |
isCreateIndex() |
boolean |
isCreateTable() |
boolean |
isMillisPrecision() |
boolean |
isSynchronizeConnection() |
void |
logInfo(java.lang.String msg)
Logs messages for debugLevel and/or consoleReport settings.
|
void |
messageString(java.lang.String msg)
Logs error and some informational messages.
|
void |
setConnectionName(java.lang.String connectionName) |
void |
setConsoleReport(boolean newValue)
sets whether or not a console report is desired.
|
void |
setCreateIndex(boolean createIndex) |
void |
setCreateTable(boolean createTable) |
void |
setDateColumnName(java.lang.String dateColumnName) |
void |
setMillisPrecision(boolean millisPrecision) |
void |
setSimulationFlag(boolean simulationFlag)
Sets the state of the simulation flag.
|
void |
setSynchronizeConnection(boolean synchronizeConnection) |
void |
setTableName(java.lang.String tableName)
Sets the name of the table.
|
void |
simulationStateChanged(SimulationChangedEvent simulationChangedEvent)
Changes the state of the simulation mode.
|
void |
start()
Enable data saving and attempt a save if a trigger has been seen.
|
void |
stop()
Close the connection.
|
boolean |
tableExists(java.lang.String tableName)
Returns true if the given tablename exists in the database, otherwise false.
|
java.lang.String |
toString()
Provides the internal byte and array output as a String.
|
getDefaultQualityForLocation
getInPortNames, getStaticLocationFor, setBooleanValue, setBoolValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setShortValue, setStringValue, valueChanged, valueInput
addConnector, addConnector, addDataSource, addPropertyChangeListener, addValueChangedListener, addVetoableChangeListener, authenticatedClientRequest, clientRequest, clientResponse, destroy, determineSuspendedStatus, getClassLicenseManager, getContainer, getCustomTimer, getDataSource, getDataSources, getDisplayName, getExportCriteria, getExposeComponentConnections, getName, getOutPortNames, getPullFromServers, getPushData, getPushName, getPushToServers, getServerListData, getTimebase, getTrace, isActive, isScreenLocal, refreshCurrentValue, removeConnector, removeDataSource, removePropertyChangeListener, removeValueChangedListener, removeVetoableChangeListener, requestSyncWrite, setAutoSuspend, setClassLicenseManager, setContainer, setCustomTimer, setDataSourceName, setExportCriteria, setExposeComponentConnections, setName, setPullFromServers, setPushData, setPushName, setPushToServers, setScreenLocal, setServerListData, setTimebase, setTrace, setValueObject, tick, VIBEvent
addVIBEventListener, checkScript, executeInScriptInternal, executeScript, executeScriptInternal, executeScriptInternal, getAutoSuspend, getBooleanValue, getBoolValue, getColorHi, getColorHiHi, getColorLo, getColorLoLo, getColorNormal, getConnectors, getConsoleLogger, getCurrentColor, getDataSourceName, getDoubleValue, getFloatValue, getGWTLogger, getIncomingValueObject, getInScript, getIntValue, getLongValue, getParent, getPopupLogger, getScript, getScriptEngine, getSendColors, getSources, getStringValue, getSyncWriteTimeout, getTimedPopupLogger, getTraceLogger, getValueHi, getValueHiHi, getValueLo, getValueLoLo, getValueObject, init, isHardSuspended, isRunning, isSendOnlyChangedValuesDefault, isSuspended, logException, logGWT, logGWT, logMessage, logTrace, n2sortConnectors, performScriptSubstitutions, popupMessage, post, removeConnector, removeVIBEventListener, replaceConnectors, scriptExtensionSubstition, setColorHi, setColorHiHi, setColorLo, setColorLoLo, setColorNormal, setConsoleLogger, setGWTLogger, setHardSuspended, setInScript, setParent, setPopupLogger, setScript, setSendColors, setSendOnlyChangedValuesDefault, setSyncWriteTimeout, setTimedPopupLogger, setTraceLogger, setValueHi, setValueHiHi, setValueLo, setValueLoLo, updateColor, updateListeners, updateListeners, updateListeners, whoAmI
public static boolean alwaysCloseConnection
public static int debugLevel
public static final int HSQLDB
public java.text.DateFormat logDateFormat
public static final int MYSQL
public static final int ORACLE
public static final int OTHER
public static final int POSTGRES
public static final int SQLITE
public void connectionClosed(ConnectionClosedEvent cce)
connectionClosed
in interface ConnectionClosedListener
public java.lang.String eventInfo(ValueChangedEvent e)
public java.lang.String getConnectionName()
public boolean getConsoleReport()
public int getDataBaseType() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getDateColumnName()
public java.lang.String getTableName()
public boolean isCreateIndex()
public boolean isCreateTable()
public boolean isMillisPrecision()
public boolean isSynchronizeConnection()
public void logInfo(java.lang.String msg)
public void messageString(java.lang.String msg)
public void setConnectionName(java.lang.String connectionName)
connectionName
- The connectionName to set.public void setConsoleReport(boolean newValue)
public void setCreateIndex(boolean createIndex)
public void setCreateTable(boolean createTable)
createTable
- The createTable to set.public void setDateColumnName(java.lang.String dateColumnName)
dateColumnName
- The dateColumnName to set.public void setMillisPrecision(boolean millisPrecision)
public void setSimulationFlag(boolean simulationFlag)
setSimulationFlag
in interface SimulationListener
simulationFlag
- will be written as "false" when code is generated.public void setSynchronizeConnection(boolean synchronizeConnection)
synchronizeConnection
- The synchronizeConnection to set.public void setTableName(java.lang.String tableName)
public void simulationStateChanged(SimulationChangedEvent simulationChangedEvent) throws java.lang.Exception
simulationStateChanged
in interface SimulationListener
java.lang.Exception
- TODOpublic void start() throws BadParameterException, VIBUpdateFailedException
start
in class SimpleDataSource
BadParameterException
VIBUpdateFailedException
public void stop() throws BadParameterException
stop
in class SimpleDataSource
BadParameterException
public boolean tableExists(java.lang.String tableName) throws java.sql.SQLException
tableName
- the table name to check forjava.sql.SQLException
- thrown if the database cannot be contacted or other error.public java.lang.String toString()
toString
in class Manipulator
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.