Top Description Fields Constructors Methods
org.h2.command.dml

public Class ScriptCommand

extends ScriptBase
Class Inheritance
Imports
java.io.BufferedInputStream, .BufferedReader, .IOException, .InputStream, .Reader, java.nio.charset.Charset, .StandardCharsets, java.sql.Connection, .PreparedStatement, .ResultSet, .SQLException, java.util.ArrayList, .Arrays, .Collection, .Comparator, .Set, .TreeMap, .TreeSet, org.h2.api.ErrorCode, org.h2.command.CommandInterface, org.h2.constraint.Constraint, org.h2.engine.Comment, .Constants, .Database, .DbObject, .Right, .RightOwner, .Role, .SessionLocal, .Setting, .User, org.h2.expression.Expression, .ExpressionColumn, org.h2.index.Cursor, .Index, org.h2.message.DbException, org.h2.mvstore.DataUtils, org.h2.result.LocalResult, .ResultInterface, .Row, org.h2.schema.Constant, .Domain, .Schema, .SchemaObject, .Sequence, .TriggerObject, .UserDefinedFunction, org.h2.table.Column, .PlanItem, .Table, .TableType, org.h2.util.HasSQL, .IOUtils, .MathUtils, .StringUtils, .Utils, org.h2.value.TypeInfo, .Value, .ValueVarchar

This class represents the statement SCRIPT

Field Summary

Modifier and TypeField and Description
private byte[]
private static final Comparator<? super DbObject>
private Charset
private boolean
private boolean
private byte[]
private String
private int
private int
private boolean
private LocalResult
private Set<String>
private boolean
private boolean
private Collection<Table>
private boolean
private boolean
private boolean
Inherited from org.h2.command.dml.ScriptBase:
outreader

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
add(String s, boolean insert)

private void
addDomain(Domain domain)

public static InputStream

Returns:

a stream for the combined data
combineBlob
(Connection
a connection
conn
,
int
the lob id
id
)

Combine a BLOB.

public static Reader

Returns:

a reader for the combined data
combineClob
(Connection
a connection
conn
,
int
the lob id
id
)

Combine a CLOB.

private LocalResult
private void
private void
private boolean
private boolean
private int
generateInsertValues(int count, Table table)

private static ResultSet
getLobStream(Connection conn, String column, int id)

public int
getType()

Implements abstract org.h2.command.Prepared.getType.

Get the command type as defined in CommandInterface

public boolean
isQuery()

Overrides org.h2.command.Prepared.isQuery.

Check if this object is a query.

public ResultInterface
query(long
the maximum number of rows to return
maxrows
)

Overrides org.h2.command.Prepared.query.

Execute the query.

public ResultInterface
queryMeta()

Implements abstract org.h2.command.Prepared.queryMeta.

Get an empty result set containing the meta data.

private void
public void
public void
setData(boolean data)

public void
setDrop(boolean drop)

public void
setLobBlockSize(long blockSize)

public void
setPasswords(boolean passwords)

public void
setSchemaNames(Set<String> schemaNames)

public void
setSettings(boolean settings)

public void
setSimple(boolean simple)

public void
public void
setVersion(boolean version)

public void
setWithColumns(boolean withColumns)

private static <T extends DbObject> T[]
sorted(Collection<T> collection, Class<T> clazz)

private int
Inherited from org.h2.command.dml.ScriptBase:
closeIOdeleteStoregetFileNameisTransactionalneedRecompileopenInputopenOutputsetCiphersetCompressionAlgorithmsetFileNameExprsetPassword

Field Detail

bufferback to summary
private byte[] buffer
BY_NAME_COMPARATORback to summary
private static final Comparator<? super DbObject> BY_NAME_COMPARATOR
charsetback to summary
private Charset charset
databack to summary
private boolean data
dropback to summary
private boolean drop
lineSeparatorback to summary
private byte[] lineSeparator
lineSeparatorStringback to summary
private String lineSeparatorString
lobBlockSizeback to summary
private int lobBlockSize
nextLobIdback to summary
private int nextLobId
passwordsback to summary
private boolean passwords
resultback to summary
private LocalResult result
schemaNamesback to summary
private Set<String> schemaNames
settingsback to summary
private boolean settings
simpleback to summary
private boolean simple
tablesback to summary
private Collection<Table> tables
tempLobTableCreatedback to summary
private boolean tempLobTableCreated
versionback to summary
private boolean version
withColumnsback to summary
private boolean withColumns

Constructor Detail

ScriptCommandback to summary
public ScriptCommand(SessionLocal session)

Method Detail

addback to summary
private void add(String s, boolean insert) throws IOException
addDomainback to summary
private void addDomain(Domain domain) throws IOException
combineBlobback to summary
public static InputStream combineBlob(Connection conn, int id) throws SQLException

Combine a BLOB. This method is called from the script. When calling with id -1, the file is deleted.

Parameters
conn:Connection

a connection

id:int

the lob id

Returns:InputStream

a stream for the combined data

Exceptions
SQLException:
on failure
combineClobback to summary
public static Reader combineClob(Connection conn, int id) throws SQLException

Combine a CLOB. This method is called from the script.

Parameters
conn:Connection

a connection

id:int

the lob id

Returns:Reader

a reader for the combined data

Exceptions
SQLException:
on failure
createResultback to summary
private LocalResult createResult()
dumpDomainsback to summary
private void dumpDomains(ArrayList<Schema> schemas) throws IOException
dumpRightsback to summary
private void dumpRights(Database db) throws IOException
excludeSchemaback to summary
private boolean excludeSchema(Schema schema)
excludeTableback to summary
private boolean excludeTable(Table table)
generateInsertValuesback to summary
private int generateInsertValues(int count, Table table) throws IOException
getLobStreamback to summary
private static ResultSet getLobStream(Connection conn, String column, int id) throws SQLException
getTypeback to summary
public int getType()

Implements abstract org.h2.command.Prepared.getType.

Doc from org.h2.command.Prepared.getType.

Get the command type as defined in CommandInterface

Returns:int

the statement type

Annotations
@Override
isQueryback to summary
public boolean isQuery()

Overrides org.h2.command.Prepared.isQuery.

Doc from org.h2.command.Prepared.isQuery.

Check if this object is a query.

Returns:boolean

true if it is

Annotations
@Override
queryback to summary
public ResultInterface query(long maxrows)

Overrides org.h2.command.Prepared.query.

Doc from org.h2.command.Prepared.query.

Execute the query.

Parameters
maxrows:long

the maximum number of rows to return

Returns:ResultInterface

the result set

Annotations
@Override
queryMetaback to summary
public ResultInterface queryMeta()

Implements abstract org.h2.command.Prepared.queryMeta.

Doc from org.h2.command.Prepared.queryMeta.

Get an empty result set containing the meta data.

Returns:ResultInterface

the result set

Annotations
@Override
resetback to summary
private void reset()
setCharsetback to summary
public void setCharset(Charset charset)
setDataback to summary
public void setData(boolean data)
setDropback to summary
public void setDrop(boolean drop)
setLobBlockSizeback to summary
public void setLobBlockSize(long blockSize)
setPasswordsback to summary
public void setPasswords(boolean passwords)
setSchemaNamesback to summary
public void setSchemaNames(Set<String> schemaNames)
setSettingsback to summary
public void setSettings(boolean settings)
setSimpleback to summary
public void setSimple(boolean simple)
setTablesback to summary
public void setTables(Collection<Table> tables)
setVersionback to summary
public void setVersion(boolean version)
setWithColumnsback to summary
public void setWithColumns(boolean withColumns)
sortedback to summary
private static <T extends DbObject> T[] sorted(Collection<T> collection, Class<T> clazz)
writeLobStreamback to summary
private int writeLobStream(Value v) throws IOException