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.String
cipher
private java.lang.String
compressionAlgorithm
private java.lang.String
fileName
private Expression
fileNameExpr
The file name (if set).protected java.io.OutputStream
out
The output stream.private Expression
password
protected java.io.BufferedReader
reader
The input reader.private static java.lang.String
SCRIPT_SQL
The default name of the script file if .zip compression is used.private FileStore
store
-
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) void
closeIO()
Close input and output streams.(package private) void
deleteStore()
Delete the target file.protected java.lang.String
getFileName()
private void
initStore()
private boolean
isEncrypted()
boolean
isTransactional()
Check if this command is transactional.boolean
needRecompile()
Check if the statement needs to be re-compiled.(package private) void
openInput(java.nio.charset.Charset charset)
Open the input stream.(package private) void
openOutput()
Open the output stream.void
setCipher(java.lang.String c)
void
setCompressionAlgorithm(java.lang.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 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: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
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:Prepared
Check if the statement needs to be re-compiled.- Overrides:
needRecompile
in classPrepared
- Returns:
- true if it must
-
setCompressionAlgorithm
public void setCompressionAlgorithm(java.lang.String algorithm)
-
-