|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.sql.SqlExecMojo
public class SqlExecMojo
Executes SQL against a database.
| Field Summary | |
|---|---|
static String |
FILE_SORTING_ASC
Call setOrderFile(String) with this value to sort in ascendant order the sql files. |
static String |
FILE_SORTING_DSC
Call setOrderFile(String) with this value to sort in descendant order the sql files. |
static String |
ON_ERROR_ABORT
Call setOnError(String) with this value to abort SQL command execution
if an error is found. |
static String |
ON_ERROR_ABORT_AFTER
Call setOnError(String) with this value to continue SQL command execution until
all commands have been attempted, then abort the build if an SQL error occurred in any
of the commands. |
static String |
ON_ERROR_CONTINUE
Call setOnError(String) with this value to continue SQL command execution
if an error is found. |
| Fields inherited from interface org.apache.maven.plugin.Mojo |
|---|
ROLE |
| Constructor Summary | |
|---|---|
SqlExecMojo()
|
|
| Method Summary | |
|---|---|
void |
addText(String sql)
Set an inline SQL command to execute. |
org.codehaus.mojo.sql.SqlExecMojo.Transaction |
createTransaction()
Add a SQL transaction to execute |
void |
execute()
Load the sql file and then execute it |
String |
getDriver()
|
protected Properties |
getDriverProperties()
parse driverProperties into Properties set |
String |
getOnError()
|
String |
getOrderFile()
|
String |
getPassword()
|
String |
getSqlCommand()
|
File[] |
getSrcFiles()
|
int |
getSuccessfulStatements()
Number of SQL statements executed so far that caused errors. |
int |
getTotalStatements()
Number of SQL statements executed so far, including the ones that caused errors. |
List |
getTransactions()
|
String |
getUrl()
|
String |
getUsername()
|
boolean |
isEnableBlockMode()
|
void |
setAppend(boolean append)
whether output should be appended to or overwrite an existing file. |
void |
setDelimiter(String delimiter)
Set the delimiter that separates SQL statements. |
void |
setDelimiterType(String delimiterType)
Set the delimiter type: "normal" or "row" (default "normal"). |
void |
setDriver(String driver)
|
void |
setDriverProperties(String driverProperties)
|
void |
setEnableBlockMode(boolean enableBlockMode)
|
void |
setEncoding(String encoding)
Set the file encoding to use on the SQL files read in |
void |
setEscapeProcessing(boolean enable)
Set escape processing for statements. |
void |
setFileFilter(org.apache.maven.shared.filtering.MavenFileFilter filter)
|
void |
setKeepFormat(boolean keepformat)
whether or not format should be preserved. |
void |
setOnError(String action)
|
void |
setOrderFile(String orderFile)
|
void |
setOutputFile(File output)
Set the output file; |
void |
setPassword(String password)
|
void |
setPrintResultSet(boolean print)
Print result sets from the statements; optional, default false |
void |
setPrintResutlSet(boolean print)
Deprecated. Typo, setPrintResultSet(boolean) instead. |
void |
setSecurityDispatcher(org.sonatype.plexus.components.sec.dispatcher.SecDispatcher securityDispatcher)
|
void |
setShowheaders(boolean showheaders)
Print headers for result sets from the statements; optional, default true. |
void |
setSqlCommand(String sqlCommand)
|
void |
setSrcFiles(File[] files)
|
void |
setTransactions(List transactions)
|
void |
setUrl(String url)
|
void |
setUsername(String username)
|
protected boolean |
skipMojo()
Determine if the mojo execution should get skipped. |
| Methods inherited from class org.apache.maven.plugin.AbstractMojo |
|---|
getLog, getPluginContext, setLog, setPluginContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ON_ERROR_ABORT
setOnError(String) with this value to abort SQL command execution
if an error is found.
public static final String ON_ERROR_ABORT_AFTER
setOnError(String) with this value to continue SQL command execution until
all commands have been attempted, then abort the build if an SQL error occurred in any
of the commands.
public static final String ON_ERROR_CONTINUE
setOnError(String) with this value to continue SQL command execution
if an error is found.
public static final String FILE_SORTING_ASC
setOrderFile(String) with this value to sort in ascendant order the sql files.
public static final String FILE_SORTING_DSC
setOrderFile(String) with this value to sort in descendant order the sql files.
| Constructor Detail |
|---|
public SqlExecMojo()
| Method Detail |
|---|
public org.codehaus.mojo.sql.SqlExecMojo.Transaction createTransaction()
public void addText(String sql)
sql - the sql statement to addpublic void setEncoding(String encoding)
encoding - the encoding to use on the filespublic void setDelimiter(String delimiter)
delimiter - the new delimiterpublic void setDelimiterType(String delimiterType)
delimiterType - the new delimiterTypepublic void setPrintResutlSet(boolean print)
setPrintResultSet(boolean) instead.
print - true to print the resultset, otherwise falsepublic void setPrintResultSet(boolean print)
print - true to print the resultset, otherwise falsepublic void setShowheaders(boolean showheaders)
showheaders - true to show the headers, otherwise falsepublic void setOutputFile(File output)
output - the output filepublic void setAppend(boolean append)
append - true to append, otherwise false to overwritepublic void setKeepFormat(boolean keepformat)
keepformat - The keepformat to setpublic void setEscapeProcessing(boolean enable)
enable - true to escape, otherwiser falseprotected boolean skipMojo()
Determine if the mojo execution should get skipped.
This is the case if:skip is trueforceMojoExecution is false
true if the mojo execution should be skipped.
public void execute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected Properties getDriverProperties()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic String getUsername()
public void setUsername(String username)
public String getPassword()
public void setPassword(String password)
public String getUrl()
public void setUrl(String url)
public String getDriver()
public void setDriver(String driver)
public File[] getSrcFiles()
public void setSrcFiles(File[] files)
public String getOrderFile()
public void setOrderFile(String orderFile)
public int getSuccessfulStatements()
public int getTotalStatements()
public String getOnError()
public void setOnError(String action)
public void setDriverProperties(String driverProperties)
public boolean isEnableBlockMode()
public void setEnableBlockMode(boolean enableBlockMode)
public String getSqlCommand()
public void setSqlCommand(String sqlCommand)
public List getTransactions()
public void setTransactions(List transactions)
public void setFileFilter(org.apache.maven.shared.filtering.MavenFileFilter filter)
public void setSecurityDispatcher(org.sonatype.plexus.components.sec.dispatcher.SecDispatcher securityDispatcher)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||