|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
net.sourceforge.jdbcimporter.ant.JDBCImporterTask
The JDBCImporterTask class is the Ant task that controls the import of data to the database.
Field Summary | |
protected ConnectionDefElement |
connectionElement
The ConnectionDefElement containing the connection definition. |
protected java.lang.String |
engineClassname
The class name of the engine used for the import. |
protected java.util.List |
entityElements
The list of ElementDefElement. |
protected boolean |
failOnError
Flag indicating that the import should stop on the first error (default is false). |
protected ImportDef |
importDef
The import definition. |
protected static org.apache.commons.logging.Log |
LOG
The log for debug information. |
protected java.util.Map |
plugins
The mapping between connection definition/delimiter parser types and implementations. |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
JDBCImporterTask()
Create a JDBCImporter Ant task. |
Method Summary | |
void |
addConfiguredProperty(PropertyElement element)
Adds a property to the plugin properties. |
static void |
applyProperty(java.lang.Object obj,
java.lang.String name,
java.lang.String value)
Apply the property to the given object. |
ConnectionDefElement |
createConnection()
Creates an empty ConnectionDefElement and returns it. |
ImportEntityDefElement |
createEntity()
Creates an empty EntityDefElement and returns it. |
void |
execute()
Import data into the database by processing each entity definition via the import engine. |
void |
setBatchCount(int count)
Sets the number of rows to import before calling execute batch. |
void |
setCommitCount(int count)
Sets the number of rows to import before committing. |
void |
setEngine(java.lang.String className)
Sets the class name of the engine used for the import. |
void |
setFailonerror(boolean flag)
Sets a flag to indicate that the import should stop after the first error. |
void |
setPostSQLFile(java.io.File file)
Sets the file containing the sql statements that will be executed after the import. |
void |
setPreSQLFile(java.io.File file)
Sets the file containing the sql statements that will be executed before the import. |
void |
setTrimValues(boolean flag)
Sets the flag indicating whether values should be trimmed after reading them from the delimiter parser. |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static org.apache.commons.logging.Log LOG
protected java.lang.String engineClassname
protected ImportDef importDef
protected ConnectionDefElement connectionElement
protected java.util.List entityElements
protected java.util.Map plugins
protected boolean failOnError
Constructor Detail |
public JDBCImporterTask()
Method Detail |
public void setEngine(java.lang.String className)
className
- the class namepublic void setBatchCount(int count)
count
- the number of rowspublic void setCommitCount(int count)
count
- the number of rowspublic void setPreSQLFile(java.io.File file)
file
- the filepublic void setPostSQLFile(java.io.File file)
file
- the filepublic void setTrimValues(boolean flag)
flag
- trim values flag.public void setFailonerror(boolean flag)
flag
- flagpublic ConnectionDefElement createConnection()
public ImportEntityDefElement createEntity()
public void addConfiguredProperty(PropertyElement element)
element
- the property elementpublic void execute() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
- if there is no connection definition or entity definitionspublic static void applyProperty(java.lang.Object obj, java.lang.String name, java.lang.String value) throws org.apache.tools.ant.BuildException
obj
- the objectname
- the name of the propertyvalue
- the string value of the property
org.apache.tools.ant.BuildException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |