|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.webdocwf.util.loader.Loader
Loader class loads data from source database into target database using criteria
set in XML file which is used as parameter. Also Loader can execute SQL statements
which import from XML file.
All loading rolls are set in XML file. Some capabilities of this loader are:
there could be more then one importDefinition and number of them is not limited, source
and target database could be different, source database could be ASCII,Excel or Access file too,
operator (the person or application which starts Loader) have to define.
Restart mode with second parameter (optional).
There are two possible ways to start Loader. The first is as stand alone application,
the sintaxs is:
java org.webdocwf.util.loader.Loader [-options] urlOfTheXmlFile.xml
urlOfTheXmlFile.xml is URL of the XML file with loading criteria,
The second way is to start Loader as package, the sintax is:
public Loader(String loadJobFileName, String mode, String userID, String logDirName,
String logFileName, boolean restartIndicator, Map variableValues, String vendorFileName,
boolean onErrorContinue, String additionalPaths, int commitCount, int returnCode) ;
ldr.load();
If we want to execute Loader class without last for parameters, we must put null as these arguments
When the Loader is started the log file is generated. Log file is txt file and its name defines date and time when the Loader is started. There are three Log modes: none - report only begining and finishing the application, and exceptions if there are any, normal - add to log importing blocks and full - with detailed report to operator.
Another big adventage of Loader is its possibility to execute any SQL statements in target database. (creating database; creating, modifying and deleting tables...)
XML file the key part for loading criteria. XML tags define how the loading job will be done.
Field Summary | |
static java.lang.String |
LOGMODE_FULL
|
static java.lang.String |
LOGMODE_NONE
|
static java.lang.String |
LOGMODE_NORMAL
|
Constructor Summary | |
Loader(java.lang.String loadJobFileName)
Public constructor of Loader class. |
|
Loader(java.lang.String loadJobFileName,
java.lang.String mode,
java.lang.String userID,
java.lang.String logDirName,
java.lang.String logFileName,
boolean restartIndicator,
java.util.Map variableValues,
java.lang.String vendorFileName,
boolean onErrorContinue,
java.lang.String additionalPaths,
int commitCount,
int returnCode)
Construct object Loader with an associated parameters. |
Method Summary | |
java.lang.String |
getAdditionalPaths()
Read value of additionalPaths attribute. |
int |
getCommitCount()
Read value of commitCount attribute. |
int |
getDefaultReturnCode()
Read value of default error return code attribute. |
java.lang.String |
getLoadJobFileName()
Read value of loadJobFileName attribute. |
java.lang.String |
getLogDirName()
Read value of logDirName attribute |
java.lang.String |
getLogFileName()
Read value of logFileName attribute. |
java.lang.String |
getMode()
Read value of Mode(LogMode) attribute. |
boolean |
getOnErrorContinue()
read value of onErrorContinue attribute. |
boolean |
getRestartIndicator()
Read value of restartIndicator attribute. |
java.lang.String |
getUserID()
Read value of userID attribute. |
java.util.Map |
getVariableValues()
Read value of variableValues attribute. |
java.lang.String |
getVendorFileName()
Read value of vendorFileName. |
void |
load()
Method load is main method in class Loader. |
static void |
main(java.lang.String[] argv)
Main method Loader with an associated XML, restart mode (optional) i user (optional). |
void |
setAdditionalPaths(java.lang.String additionalPaths)
This method sets value of additionalPaths attribute. |
void |
setCommitCount(int commitCount)
This method sets value of commitCount attribute. |
void |
setDefaultReturnCode(int code)
This method sets value of default error return code attribute. |
void |
setLoadJobFileName(java.lang.String loadJobFileName)
This method sets value of loadJobFileName attribute. |
void |
setLogDirName(java.lang.String logDirName)
This method sets value of logDirName attribute. |
void |
setLogFileName(java.lang.String logFileName)
This method sets value of logFileName attribute. |
void |
setMode(java.lang.String mode)
This method sets value of Mode attribute. |
void |
setOnErrorContinue(boolean onErrorContinue)
This method sets value of onErrorContinue attribute. |
void |
setRestartIndicator(boolean restartIndicator)
This method sets value of restartIndicator attribute. |
void |
setUserID(java.lang.String userID)
This method sets value of userID attribute. |
void |
setVariableValues(java.util.Map variableValue)
This method sets value of variableValues attribute. |
void |
setVendorFileName(java.lang.String vendorFileName)
This method sets value of vendorFileName attribute. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String LOGMODE_NONE
public static final java.lang.String LOGMODE_NORMAL
public static final java.lang.String LOGMODE_FULL
Constructor Detail |
public Loader(java.lang.String loadJobFileName, java.lang.String mode, java.lang.String userID, java.lang.String logDirName, java.lang.String logFileName, boolean restartIndicator, java.util.Map variableValues, java.lang.String vendorFileName, boolean onErrorContinue, java.lang.String additionalPaths, int commitCount, int returnCode)
public Loader(java.lang.String loadJobFileName)
Method Detail |
public java.lang.String getLoadJobFileName()
public void setLoadJobFileName(java.lang.String loadJobFileName)
loadJobFileName
- loadJob XML file namepublic java.lang.String getMode()
public void setMode(java.lang.String mode)
public java.lang.String getUserID()
public void setUserID(java.lang.String userID)
public java.lang.String getLogDirName()
public void setLogDirName(java.lang.String logDirName)
logDirName
- value of attribute.public java.lang.String getLogFileName()
public void setLogFileName(java.lang.String logFileName)
logFileName
- value of attribute.public boolean getRestartIndicator()
public void setRestartIndicator(boolean restartIndicator)
restartIndicator
- value of attribute.public java.util.Map getVariableValues()
public void setVariableValues(java.util.Map variableValue)
public java.lang.String getVendorFileName()
public void setVendorFileName(java.lang.String vendorFileName)
vendorFileName
- value of attribute.public boolean getOnErrorContinue()
public void setOnErrorContinue(boolean onErrorContinue)
onErrorContinue
- value of attribute.public java.lang.String getAdditionalPaths()
public void setAdditionalPaths(java.lang.String additionalPaths)
additionalPaths
- value of attribute.public int getCommitCount()
public void setCommitCount(int commitCount)
commitCount
- value of attribute.public int getDefaultReturnCode()
public void setDefaultReturnCode(int code)
public static void main(java.lang.String[] argv)
public void load() throws LoaderException
LoaderException.
LoaderException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |