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 String
private String
private String
private Expression
The file name (if set).protected OutputStream
The output stream.private Expression
protected BufferedReader
The input reader.private static final String
The default name of the script file if .zip compression is used.private FileStore
Fields inherited from class org.h2.command.Prepared
create, parameters, prepareAlways, session, sqlStatement, sqlTokens
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
closeIO()
Close input and output streams.(package private) void
Delete the target file.protected String
private void
private boolean
boolean
Check if this command is transactional.boolean
Check if the statement needs to be re-compiled.(package private) void
Open the input stream.(package private) void
Open the output stream.void
void
setCompressionAlgorithm
(String algorithm) void
setFileNameExpr
(Expression file) void
setPassword
(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:Prepared
Check if this command is transactional. If it is not, then it forces the current transaction to commit.- Specified by:
isTransactional
in 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:Prepared
Check if the statement needs to be re-compiled.- Overrides:
needRecompile
in classPrepared
- Returns:
- true if it must
-
setCompressionAlgorithm
-