public class SqlDataSourceRT extends PollingDataSource
Modifier and Type | Field and Description |
---|---|
private java.sql.Connection |
conn |
static int |
DATA_SOURCE_EXCEPTION_EVENT |
private org.apache.commons.logging.Log |
log |
static int |
STATEMENT_EXCEPTION_EVENT |
private int |
timeoutCount |
private int |
timeoutsToReconnect |
private SqlDataSourceVO |
vo |
dataPoints, pointListChanged
addedChangedPoints, ATTR_DISCONNECTED_KEY, ATTR_UNRELIABLE_KEY, pointListChangeLock, removedPoints
Constructor and Description |
---|
SqlDataSourceRT(SqlDataSourceVO vo) |
Modifier and Type | Method and Description |
---|---|
private void |
doColumnPollImpl(long time,
java.sql.PreparedStatement stmt) |
protected void |
doPoll(long time) |
private void |
doRowPollImpl(long time,
java.sql.PreparedStatement stmt) |
private long |
getTimeOverride(java.sql.ResultSetMetaData meta,
int column,
java.sql.ResultSet rs,
long time) |
private MangoValue |
getValue(SqlPointLocatorVO locatorVO,
java.sql.ResultSet rs,
java.lang.String fieldName,
long time) |
void |
initialize() |
void |
setPointValue(DataPointRT dataPoint,
PointValueTime valueTime,
SetPointSource source) |
void |
terminate() |
beginPolling, joinTermination, scheduleTimeout, setPollingPeriod, updateChangedPoints
addDataPoint, forcePointRead, getExceptionMessage, getId, getName, getPersistentData, getSerialExceptionMessage, raiseEvent, relinquish, removeDataPoint, returnToNormal, setPersistentData
public static final int DATA_SOURCE_EXCEPTION_EVENT
public static final int STATEMENT_EXCEPTION_EVENT
private final org.apache.commons.logging.Log log
private final SqlDataSourceVO vo
private java.sql.Connection conn
private int timeoutCount
private int timeoutsToReconnect
public SqlDataSourceRT(SqlDataSourceVO vo)
public void setPointValue(DataPointRT dataPoint, PointValueTime valueTime, SetPointSource source)
setPointValue
in class DataSourceRT
protected void doPoll(long time)
doPoll
in class PollingDataSource
private void doColumnPollImpl(long time, java.sql.PreparedStatement stmt) throws java.sql.SQLException
java.sql.SQLException
private void doRowPollImpl(long time, java.sql.PreparedStatement stmt) throws java.sql.SQLException
java.sql.SQLException
private MangoValue getValue(SqlPointLocatorVO locatorVO, java.sql.ResultSet rs, java.lang.String fieldName, long time) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
private long getTimeOverride(java.sql.ResultSetMetaData meta, int column, java.sql.ResultSet rs, long time) throws java.sql.SQLException
java.sql.SQLException
public void initialize()
initialize
in interface com.serotonin.util.ILifecycle
initialize
in class DataSourceRT
public void terminate()
terminate
in interface com.serotonin.util.ILifecycle
terminate
in class PollingDataSource