/* (non-Javadoc)
* @see javax.sql.DataSource#getConnection()
*/
+ @Override
public Connection getConnection() throws SQLException
{
return ds.getConnection();
}
- public CachedRowSet getData(String statement, ArrayList<Object> arguments) throws SQLException, Throwable
+ public CachedRowSet getData(String statement, ArrayList<Object> arguments)
+ throws SQLException, Throwable
{
TestObject testObject = null;
testObject = monitor.registerRequest();
}
}
- public boolean writeData(String statement, ArrayList<Object> arguments) throws SQLException, Throwable
+ public boolean writeData(String statement, ArrayList<Object> arguments)
+ throws SQLException, Throwable
{
TestObject testObject = null;
testObject = monitor.registerRequest();
}
}
- CachedRowSet executePreparedStatement(Connection conn, String statement, ArrayList<Object> arguments, boolean close) throws SQLException, Throwable
+ CachedRowSet executePreparedStatement(Connection conn, String statement,
+ ArrayList<Object> arguments, boolean close) throws SQLException, Throwable
{
long time = System.currentTimeMillis();
}
ResultSet rs = null;
+ PreparedStatement ps = null;
try {
data = RowSetProvider.newFactory().createCachedRowSet();
- PreparedStatement ps = conn.prepareStatement(statement);
+ ps = conn.prepareStatement(statement);
if(arguments != null)
{
for(int i = 0, max = arguments.size(); i < max; i++){
}
} catch(Exception exc){
+ }
+ try {
+ if (ps != null){
+ ps.close();
+ }
+ } catch (Exception exc){
+
}
}
/* (non-Javadoc)
* @see javax.sql.DataSource#getConnection(java.lang.String, java.lang.String)
*/
+ @Override
public Connection getConnection(String username, String password)
throws SQLException
{
/* (non-Javadoc)
* @see javax.sql.DataSource#getLogWriter()
*/
+ @Override
public PrintWriter getLogWriter() throws SQLException
{
return ds.getLogWriter();
/* (non-Javadoc)
* @see javax.sql.DataSource#getLoginTimeout()
*/
+ @Override
public int getLoginTimeout() throws SQLException
{
return ds.getLoginTimeout();
/* (non-Javadoc)
* @see javax.sql.DataSource#setLogWriter(java.io.PrintWriter)
*/
+ @Override
public void setLogWriter(PrintWriter out) throws SQLException
{
ds.setLogWriter(out);
/* (non-Javadoc)
* @see javax.sql.DataSource#setLoginTimeout(int)
*/
+ @Override
public void setLoginTimeout(int seconds) throws SQLException
{
ds.setLoginTimeout(seconds);
}
+ @Override
public final String getDbConnectionName(){
return connectionName;
}
return true;
}
+ @Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return false;
}
+ @Override
public <T> T unwrap(Class<T> iface) throws SQLException {
return null;
}
monitor.deleteObserver(observer);
}
+ @Override
public long getInterval() {
return interval;
}
+ @Override
public long getInitialDelay() {
return initialDelay;
}
+ @Override
public void setInterval(long value) {
interval = value;
}
+ @Override
public void setInitialDelay(long value) {
initialDelay = value;
}
+ @Override
public long getExpectedCompletionTime() {
return expectedCompletionTime;
}
+ @Override
public void setExpectedCompletionTime(long value) {
expectedCompletionTime = value;
}
+ @Override
public long getUnprocessedFailoverThreshold() {
return unprocessedFailoverThreshold;
}
+ @Override
public void setUnprocessedFailoverThreshold(long value) {
this.unprocessedFailoverThreshold = value;
}
canTakeOffLine = false;
final Thread offLineTimer = new Thread()
{
+ @Override
public void run(){
try {
Thread.sleep(30000L);