org.h2.command.dml
Class ScriptCommand

java.lang.Object
  extended by org.h2.command.Prepared
      extended by org.h2.command.dml.ScriptBase
          extended by org.h2.command.dml.ScriptCommand
All Implemented Interfaces:
DataHandler

public class ScriptCommand
extends ScriptBase

This class represents the statement SCRIPT


Field Summary
 
Fields inherited from class org.h2.command.dml.ScriptBase
in, out
 
Fields inherited from class org.h2.command.Prepared
headPos, parameters, prepareAlways, session, sqlStatement
 
Constructor Summary
ScriptCommand(Session session)
           
 
Method Summary
static java.io.InputStream combineBlob(java.sql.Connection conn, int id)
          Combine a BLOB.
static java.io.Reader combineClob(java.sql.Connection conn, int id)
          Combine a CLOB.
 boolean isQuery()
          Check if this object is a query.
 LocalResult query(int maxrows)
          Execute the query.
 LocalResult queryMeta()
          Get an empty result set containing the meta data.
 void setData(boolean data)
           
 void setDrop(boolean drop)
           
 void setLobBlockSize(long blockSize)
           
 void setPasswords(boolean passwords)
           
 void setSettings(boolean settings)
           
 void setSimple(boolean simple)
           
 
Methods inherited from class org.h2.command.dml.ScriptBase
allocateObjectId, checkPowerOff, checkWritingAllowed, compareTypeSave, createTempFile, freeUpDiskSpace, getChecksum, getDatabasePath, getFileName, getLobCompressionAlgorithm, getLobFileListCache, getLobFilesInDirectories, getLobSyncObject, getMaxLengthInplaceLob, getTempFileDeleter, getTrace, handleInvalidChecksum, isTransactional, needRecompile, openFile, setCipher, setCompressionAlgorithm, setFileNameExpr, setPassword
 
Methods inherited from class org.h2.command.Prepared
checkCanceled, checkParameters, getCurrentObjectId, getCurrentRowNumber, getObjectId, getParameters, getPlanSQL, getSQL, getSQL, getSQL, isReadOnly, prepare, setCommand, setCurrentRowNumber, setHeadPos, setObjectId, setParameterList, setPrepareAlways, setRow, setSession, setSQL, toString, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScriptCommand

public ScriptCommand(Session session)
Method Detail

isQuery

public boolean isQuery()
Description copied from class: Prepared
Check if this object is a query.

Overrides:
isQuery in class Prepared
Returns:
true if it is

setData

public void setData(boolean data)

setPasswords

public void setPasswords(boolean passwords)

setSettings

public void setSettings(boolean settings)

setLobBlockSize

public void setLobBlockSize(long blockSize)

setDrop

public void setDrop(boolean drop)

queryMeta

public LocalResult queryMeta()
                      throws java.sql.SQLException
Description copied from class: Prepared
Get an empty result set containing the meta data.

Specified by:
queryMeta in class Prepared
Returns:
an empty result set
Throws:
java.sql.SQLException

query

public LocalResult query(int maxrows)
                  throws java.sql.SQLException
Description copied from class: Prepared
Execute the query.

Overrides:
query in class Prepared
Parameters:
maxrows - the maximum number of rows to return
Returns:
the result set
Throws:
java.sql.SQLException - if it is not a query

combineBlob

public static java.io.InputStream combineBlob(java.sql.Connection conn,
                                              int id)
                                       throws java.sql.SQLException
Combine a BLOB. This method is called from the script. When calling with id -1, the file is deleted.

Parameters:
conn - a connection
id - the lob id
Returns:
a stream for the combined data
Throws:
java.sql.SQLException

combineClob

public static java.io.Reader combineClob(java.sql.Connection conn,
                                         int id)
                                  throws java.sql.SQLException
Combine a CLOB. This method is called from the script.

Parameters:
conn - a connection
id - the lob id
Returns:
a reader for the combined data
Throws:
java.sql.SQLException

setSimple

public void setSimple(boolean simple)