|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.empire.db.DBSQLScript
public class DBSQLScript
DBSQLScript
This class is a collection of sql command strings.
The class is used for obtaining and executing DDL commands supplied
by the database driver (@see DBDatabaseDriver.getDDLScript(DBCmdType, DBObject, DBSQLScript)
)
Field Summary | |
---|---|
protected String |
commandSeparator
|
protected ArrayList<String> |
sqlCmdList
|
Constructor Summary | |
---|---|
DBSQLScript()
|
|
DBSQLScript(String commandSeparator)
|
Method Summary | |
---|---|
void |
addStmt(String sql)
Adds a statement to the script. |
void |
addStmt(StringBuilder sql)
Adds a statement to the script. The supplied StringBuilder will be reset to a length of 0 |
void |
clear()
Clears the script by removing all statements |
int |
getCount()
Returns the number of statements in this script |
String |
getStmt(int i)
Returns the statement at the given index |
Iterator<String> |
iterator()
Returns an iterator |
void |
run(DBDatabaseDriver driver,
Connection conn)
Runs all SQL Statements using the supplied driver and connection. |
void |
run(DBDatabaseDriver driver,
Connection conn,
boolean ignoreErrors)
Runs all SQL Statements using the supplied driver and connection. |
String |
toString()
Returns the sql script as a string |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected String commandSeparator
protected ArrayList<String> sqlCmdList
Constructor Detail |
---|
public DBSQLScript()
public DBSQLScript(String commandSeparator)
Method Detail |
---|
public void addStmt(String sql)
sql
- the statementpublic final void addStmt(StringBuilder sql)
sql
- the statementpublic int getCount()
public String getStmt(int i)
i
- index of the statement to retrieve
public void clear()
public void run(DBDatabaseDriver driver, Connection conn, boolean ignoreErrors)
driver
- the driver used for statement executionconn
- the connectionignoreErrors
- true if errors should be ignoredpublic void run(DBDatabaseDriver driver, Connection conn)
driver
- the driver used for statement executionconn
- the connectionpublic Iterator<String> iterator()
iterator
in interface Iterable<String>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |