| |
|
| java.lang.Object org.netbeans.lib.ddl.util.CommandBuffer
CommandBuffer | public class CommandBuffer (Code) | | Command buffer used to execute a bunch of commands. Main advantages of using
buffer is:
- Optimized connection handling. Buffer opens JDBC connection before executing
of first command and closes it after a last one. It's safely then manually
handling connection and better then leaving commands open and close connection
for each comand separately.
- Exception handler. You can assign an exception handler to buffer. When any
error occures during the execution, this handler catches it and lets user to
decide if continue or not (when you're dropping nonexisting table, you probably
would like to continue).
- Debgging. You can set up debug mode and buffer will print each command to
System.out before execution.
author: Slavek Psenicka |
debugmode | boolean debugmode(Code) | | Debug mode
|
executionWithException | boolean executionWithException(Code) | | Execution command with some exception
|
add | public void add(DDLCommand cmd)(Code) | | Adds command to buffer
Parameters: cmd - Command to add. |
execute | public void execute() throws DDLException(Code) | | Executes commnds in buffer.
Buffer opens JDBC connection before executing (if isn't already open)
of first command and closes it after a last one. It's safely then manually
handling connection and better then leaving commands open and close connection
for each comand separately. You can also assign an exception handler to buffer.
When any error occures during the execution, this handler catches it and lets user to
decide if continue or not (when you're dropping nonexisting table, you probably
would like to continue).
|
getCommands | public String getCommands() throws DDLException(Code) | | Returns a string with string representation of all commands in buffer
|
isDebugMode | public boolean isDebugMode()(Code) | | Returns true if debugging mode is on.
You can set up debug mode and buffer will print each command to
System.out before execution.
|
setDebugMode | public void setDebugMode(boolean flag)(Code) | | Sets debug mode on/off.
You can set up debug mode and buffer will print each command to
System.out before execution.
Parameters: flag - true = debugging enabled |
setExceptionHandler | public void setExceptionHandler(CommandBufferExceptionHandler hand)(Code) | | Sets exception handler.
This handler will catch and alows user to solve all exception throwed during
the executing of buffered commands.
|
wasException | public boolean wasException()(Code) | | information about appearance some exception in the last execute a bunch of commands
|
|
|
|