Package org.h2.command.dml
Class ScriptBase
- java.lang.Object
-
- org.h2.command.Prepared
-
- org.h2.command.dml.ScriptBase
-
- Direct Known Subclasses:
RunScriptCommand,ScriptCommand
abstract class ScriptBase extends Prepared
This class is the base for RunScriptCommand and ScriptCommand.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringcipherprivate java.lang.StringcompressionAlgorithmprivate java.lang.StringfileNameprivate ExpressionfileNameExprThe file name (if set).protected java.io.OutputStreamoutThe output stream.private Expressionpasswordprotected java.io.BufferedReaderreaderThe input reader.private static java.lang.StringSCRIPT_SQLThe default name of the script file if .zip compression is used.private FileStorestore-
Fields inherited from class org.h2.command.Prepared
create, parameters, prepareAlways, session, sqlStatement, sqlTokens
-
-
Constructor Summary
Constructors Constructor Description ScriptBase(SessionLocal session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcloseIO()Close input and output streams.(package private) voiddeleteStore()Delete the target file.protected java.lang.StringgetFileName()private voidinitStore()private booleanisEncrypted()booleanisTransactional()Check if this command is transactional.booleanneedRecompile()Check if the statement needs to be re-compiled.(package private) voidopenInput(java.nio.charset.Charset charset)Open the input stream.(package private) voidopenOutput()Open the output stream.voidsetCipher(java.lang.String c)voidsetCompressionAlgorithm(java.lang.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 Detail
-
SCRIPT_SQL
private static final java.lang.String SCRIPT_SQL
The default name of the script file if .zip compression is used.- See Also:
- Constant Field Values
-
out
protected java.io.OutputStream out
The output stream.
-
reader
protected java.io.BufferedReader reader
The input reader.
-
fileNameExpr
private Expression fileNameExpr
The file name (if set).
-
password
private Expression password
-
fileName
private java.lang.String fileName
-
cipher
private java.lang.String cipher
-
store
private FileStore store
-
compressionAlgorithm
private java.lang.String compressionAlgorithm
-
-
Constructor Detail
-
ScriptBase
ScriptBase(SessionLocal session)
-
-
Method Detail
-
setCipher
public void setCipher(java.lang.String c)
-
isEncrypted
private boolean isEncrypted()
-
setPassword
public void setPassword(Expression password)
-
setFileNameExpr
public void setFileNameExpr(Expression file)
-
getFileName
protected java.lang.String 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
void openInput(java.nio.charset.Charset charset)
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
public void setCompressionAlgorithm(java.lang.String algorithm)
-
-