|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectproper.core.ProperObject
proper.database.ConnectorObject
proper.database.Executor
public class Executor
This class executes SQL-Statements (try-catch-wrapper to avoid long code).
Field Summary |
---|
Fields inherited from interface proper.core.ProperInterface |
---|
VERSION |
Constructor Summary | |
---|---|
Executor(Connector conn)
initializes the object |
Method Summary | |
---|---|
int |
count(java.lang.String sql)
returns the number of columns this statement will return, -1 if it does not succeed |
int |
getDistinctCount(java.lang.String table,
java.lang.String column)
returns the number of distinct records in a table for a given column, returns -1 if not successful |
int |
getDistinctCount(java.lang.String table,
java.util.Vector columns)
returns the number of distinct records in a table for the given columns, returns -1 if not successful |
java.util.Vector |
getDistinctValues(java.lang.String table,
java.lang.String column)
returns the distinct values in a table for a given column |
java.util.Vector |
getDistinctValues(java.lang.String table,
java.lang.String column,
boolean classified)
returns the distinct values in a table for a given column, we can can restrict to classified rows, i.e. |
java.lang.Exception |
getLastException()
returns the last Exception (can be null) |
java.lang.String |
getLastStatement()
returns the last SQL statement |
int |
getRecordCount(java.lang.String table)
returns the number of records in a table, returns -1 if not successful |
int |
getRecordCount(java.lang.String table,
java.lang.String column,
boolean classified)
returns the number of records in a table, returns -1 if not successful |
java.sql.ResultSet |
select(java.lang.String sql)
executes the given SELECT-statement and returns the result-set |
boolean |
update(java.lang.String sql)
executes the given SQL-statement (INSERT, UDPATE or DELETE) and returns whether it succeeded |
Methods inherited from class proper.database.ConnectorObject |
---|
getConnector |
Methods inherited from class proper.core.ProperObject |
---|
addListener, addOutput, classInVerbose, debugprint, debugprint, debugprint, debugprint, debugprintln, debugprintln, debugprintln, debugprintln, debugprintln, getListeners, getRuntime, getVerbose, getVerboseLevel, getVerboseLevelForClass, getVerboseString, getVerboseStringForClass, notifyListener, notifyListeners, print, print, print, print, println, println, println, println, println, printMemory, removeListener, setOutput, setVerbose, setVerboseLevel, setVerboseString, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Executor(Connector conn)
conn
- the Connector to use for accessing the DBMethod Detail |
---|
public java.sql.ResultSet select(java.lang.String sql)
public boolean update(java.lang.String sql)
public int count(java.lang.String sql)
public int getRecordCount(java.lang.String table)
public int getRecordCount(java.lang.String table, java.lang.String column, boolean classified)
table
- the table to count the rowscolumn
- the column to check for classified or unclassified
instances, if "" it is ignoredclassified
- whether to check for classified or unclassified
instances, is ignored if column == ""public int getDistinctCount(java.lang.String table, java.lang.String column)
public int getDistinctCount(java.lang.String table, java.util.Vector columns)
public java.util.Vector getDistinctValues(java.lang.String table, java.lang.String column)
public java.util.Vector getDistinctValues(java.lang.String table, java.lang.String column, boolean classified)
public java.lang.Exception getLastException()
public java.lang.String getLastStatement()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |