|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javatools.sql.ScriptExecutor
It's an abstract class for use in executing a script for a DBMS.
Constructor Summary | |
ScriptExecutor()
Creates new ScriptExecutor |
Method Summary | |
void |
execScript()
Executes the loaded script. |
void |
execScript(java.lang.String scriptFileName)
Loads and executes a specified script file. |
DbDatabase |
getDatabase()
Returns a reference to the DbDatabase object used. |
java.lang.String |
getDBMS()
Returns the name of the DBMS used. |
java.lang.String |
getPassword()
Returns the password used for connection. |
java.lang.String |
getUserName()
Returns the username. |
void |
loadScript(java.lang.String scriptFileName)
Loads the script to be executed. |
void |
setAccess(java.lang.String user,
java.lang.String pass)
Sets access information for communication with DBMS. |
void |
setDatabase(DbManager manager,
java.lang.String name,
java.lang.String driver,
java.lang.String connectString,
java.lang.String userName,
java.lang.String password)
Sets the database to use. |
void |
setDBMS(java.lang.String dbmsName)
Sets the name of the DBMS to be used. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ScriptExecutor()
Method Detail |
public void setDBMS(java.lang.String dbmsName)
dbmsName
- The name of DBMS to be used.public java.lang.String getDBMS()
public void setDatabase(DbManager manager, java.lang.String name, java.lang.String driver, java.lang.String connectString, java.lang.String userName, java.lang.String password)
manager
- The DbManager to use for getting properties.name
- Name of DBMS.driver
- Name of JDBC driver class.connectString
- Connection string to the database.userName
- User name to connect to DBMS. It must not be included into connectString
!password
- Password to connect to DBMS. It must not be included into connectString
!public DbDatabase getDatabase() throws DbException
DbException
- If DbDatabase object is null.public void loadScript(java.lang.String scriptFileName) throws java.io.FileNotFoundException
scriptFileName
- Path to the file to be loaded.
java.io.FileNotFoundException
- If the file is not found.public void execScript() throws DbException
DbException
- If the execution caused a fault.public void execScript(java.lang.String scriptFileName) throws java.io.FileNotFoundException, DbException
scriptFileName
- Path to the file to be executed.
DbException
- If the execution caused a fault.
java.io.FileNotFoundException
- If the file is not found.public void setAccess(java.lang.String user, java.lang.String pass)
user
- Username. You can use an empty string if you want to use no username.pass
- Password.public java.lang.String getUserName()
public java.lang.String getPassword()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |