Package org.dellroad.stuff.schema
Class SQLCommand
java.lang.Object
org.dellroad.stuff.schema.SQLCommand
- All Implemented Interfaces:
DatabaseAction<Connection>
An SQL
DatabaseAction that executes a single SQL statement.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
log
-
-
Constructor Details
-
SQLCommand
Constructor.- Parameters:
sql- the SQL to execute; must be a single statement- Throws:
IllegalArgumentException- ifsqlis null or contains only whitespace
-
-
Method Details
-
getSQL
-
apply
Execute the SQL statement.The implementation in
SQLCommandcreates aStatementand then executes the configured SQL command viaStatement.execute(java.lang.String). Subclasses may wish to override.- Specified by:
applyin interfaceDatabaseAction<Connection>- Parameters:
c- open transaction- Throws:
SQLException- if an error occurs while accessing the database
-