org.logicalcobwebs.dbscript
Class Commander

java.lang.Object
  extended by org.logicalcobwebs.dbscript.Commander
All Implemented Interfaces:
java.lang.Runnable

 class Commander
extends java.lang.Object
implements java.lang.Runnable

A thread that can run a single command many times.

Since:
Proxool 0.5
Version:
$Revision: 1.6 $, $Date: 2003/03/03 11:12:03 $
Author:
Bill Horsman (bill@logicalcobwebs.co.uk), $Author: billhorsman $ (current maintainer)

Field Summary
private  ConnectionAdapterIF adapter
           
private  CommandIF command
           
private  CommandFilterIF commandFilter
           
private  boolean finished
           
private static Log LOG
           
 
Constructor Summary
Commander(ConnectionAdapterIF adapter, CommandIF commandIF, CommandFilterIF commandFilter)
           
 
Method Summary
private static void execute(java.sql.Connection connection, java.lang.String sql)
          Execute and SQL statement
protected  boolean isFinished()
          Is the thread running
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG

adapter

private ConnectionAdapterIF adapter

command

private CommandIF command

commandFilter

private CommandFilterIF commandFilter

finished

private boolean finished
Constructor Detail

Commander

public Commander(ConnectionAdapterIF adapter,
                 CommandIF commandIF,
                 CommandFilterIF commandFilter)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

isFinished

protected boolean isFinished()
Is the thread running

Returns:
true if it's finished, else false

execute

private static final void execute(java.sql.Connection connection,
                                  java.lang.String sql)
                           throws java.sql.SQLException
Execute and SQL statement

Parameters:
connection - used to execute statement
sql - the SQL to perform
Throws:
java.sql.SQLException - if anything goes wrong