Package org.h2.command.dml
Class ScriptBase
java.lang.Object
org.h2.command.Prepared
org.h2.command.dml.ScriptBase
- Direct Known Subclasses:
RunScriptCommand,ScriptCommand
This class is the base for RunScriptCommand and ScriptCommand.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate Stringprivate Stringprivate ExpressionThe file name (if set).protected OutputStreamThe output stream.private Expressionprotected BufferedReaderThe input reader.private static final StringThe default name of the script file if .zip compression is used.private FileStoreFields inherited from class org.h2.command.Prepared
create, parameters, prepareAlways, session, sqlStatement, sqlTokens -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidcloseIO()Close input and output streams.(package private) voidDelete the target file.protected Stringprivate voidprivate booleanbooleanCheck if this command is transactional.booleanCheck if the statement needs to be re-compiled.(package private) voidOpen the input stream.(package private) voidOpen the output stream.voidvoidsetCompressionAlgorithm(String algorithm) voidsetFileNameExpr(Expression file) voidsetPassword(Expression password) Methods inherited from class org.h2.command.Prepared
checkCanceled, checkParameters, collectDependencies, getCteCleanups, getCurrentRowNumber, getObjectId, getParameters, getPersistedObjectId, getPlanSQL, getSession, getSimpleSQL, getSQL, getSQLTokens, getType, isCacheable, isQuery, isReadOnly, prepare, query, queryMeta, setCommand, setCteCleanups, setCurrentRowNumber, setParameterList, setPersistedObjectId, setPrepareAlways, setRow, setSession, setSQL, toString, update
-
Field Details
-
SCRIPT_SQL
The default name of the script file if .zip compression is used.- See Also:
-
out
The output stream. -
reader
The input reader. -
fileNameExpr
The file name (if set). -
password
-
fileName
-
cipher
-
store
-
compressionAlgorithm
-
-
Constructor Details
-
ScriptBase
ScriptBase(SessionLocal session)
-
-
Method Details
-
setCipher
-
isEncrypted
private boolean isEncrypted() -
setPassword
-
setFileNameExpr
-
getFileName
-
isTransactional
public boolean isTransactional()Description copied from class:PreparedCheck if this command is transactional. If it is not, then it forces the current transaction to commit.- Specified by:
isTransactionalin classPrepared- Returns:
- true if it is
-
deleteStore
void deleteStore()Delete the target file. -
initStore
private void initStore() -
openOutput
void openOutput()Open the output stream. -
openInput
Open the input stream.- Parameters:
charset- the charset to use
-
closeIO
void closeIO()Close input and output streams. -
needRecompile
public boolean needRecompile()Description copied from class:PreparedCheck if the statement needs to be re-compiled.- Overrides:
needRecompilein classPrepared- Returns:
- true if it must
-
setCompressionAlgorithm
-