org.hsqldb.scriptio
Class ScriptWriterText
- java.lang.Object
-
- org.hsqldb.scriptio.ScriptWriterBase
-
- org.hsqldb.scriptio.ScriptWriterText
-
- All Implemented Interfaces:
- java.lang.Runnable
- Direct Known Subclasses:
- ScriptWriterEncode
public class ScriptWriterText extends ScriptWriterBase
Handles all scripting and logging operations. A script consists of two blocks:DDL: SQL statements for table and user definitions DATA: INSERT statements for memory tables This happens as part of the CHECKPOINT and SHUTDOWN COMPACT process. In this case, the DATA block contains the CACHED table data as well.
A related use for this class is for saving a current snapshot of the database data to a user-defined file with the SCRIPT command A log consists of SQL statements of different types. Each statement is encoded as ASCII and saved.
- Since:
- 1.7.2
-
-
Field Summary
Fields Modifier and Type Field and Description static byte[]BYTES_LINE_SEPstatic java.lang.StringISO_8859_1-
Fields inherited from class org.hsqldb.scriptio.ScriptWriterBase
LIST_SCRIPT_FORMATS
-
-
Constructor Summary
Constructors Constructor and Description ScriptWriterText(Database db, java.io.OutputStream outputStream, FileAccess.FileSync descriptor, boolean includeCachedData)ScriptWriterText(Database db, java.lang.String file, boolean includeCachedData, boolean compressed)ScriptWriterText(Database db, java.lang.String file, boolean includeCachedData, boolean newFile, boolean isDump)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidwriteCommitStatement(Session session)voidwriteDeleteStatement(Session session, Table table, java.lang.Object[] data)voidwriteInsertStatement(Session session, Row row, Table table)voidwriteLogStatement(Session session, java.lang.String s)voidwriteOtherStatement(Session session, java.lang.String s)voidwriteRow(Session session, Row row, Table table)voidwriteSequenceStatement(Session session, NumberSequence seq)voidwriteTableInit(Table t)-
Methods inherited from class org.hsqldb.scriptio.ScriptWriterBase
close, forceSync, getWriteDelay, run, setIncludeCachedData, setIncludeIndexRoots, setWriteDelay, size, start, stop, sync, writeAll, writeDDL, writeExistingData, writeTableTerm
-
-
-
-
Field Detail
-
ISO_8859_1
public static final java.lang.String ISO_8859_1
- See Also:
- Constant Field Values
-
BYTES_LINE_SEP
public static byte[] BYTES_LINE_SEP
-
-
Constructor Detail
-
ScriptWriterText
public ScriptWriterText(Database db, java.io.OutputStream outputStream, FileAccess.FileSync descriptor, boolean includeCachedData)
-
ScriptWriterText
public ScriptWriterText(Database db, java.lang.String file, boolean includeCachedData, boolean newFile, boolean isDump)
-
ScriptWriterText
public ScriptWriterText(Database db, java.lang.String file, boolean includeCachedData, boolean compressed)
-
-
Method Detail
-
writeLogStatement
public void writeLogStatement(Session session, java.lang.String s) throws java.io.IOException
- Specified by:
writeLogStatementin classScriptWriterBase- Throws:
java.io.IOException
-
writeRow
public void writeRow(Session session, Row row, Table table) throws java.io.IOException
- Specified by:
writeRowin classScriptWriterBase- Throws:
java.io.IOException
-
writeTableInit
public void writeTableInit(Table t) throws java.io.IOException
- Overrides:
writeTableInitin classScriptWriterBase- Throws:
java.io.IOException
-
writeOtherStatement
public void writeOtherStatement(Session session, java.lang.String s) throws java.io.IOException
- Specified by:
writeOtherStatementin classScriptWriterBase- Throws:
java.io.IOException
-
writeInsertStatement
public void writeInsertStatement(Session session, Row row, Table table) throws java.io.IOException
- Specified by:
writeInsertStatementin classScriptWriterBase- Throws:
java.io.IOException
-
writeDeleteStatement
public void writeDeleteStatement(Session session, Table table, java.lang.Object[] data) throws java.io.IOException
- Specified by:
writeDeleteStatementin classScriptWriterBase- Throws:
java.io.IOException
-
writeSequenceStatement
public void writeSequenceStatement(Session session, NumberSequence seq) throws java.io.IOException
- Specified by:
writeSequenceStatementin classScriptWriterBase- Throws:
java.io.IOException
-
writeCommitStatement
public void writeCommitStatement(Session session) throws java.io.IOException
- Specified by:
writeCommitStatementin classScriptWriterBase- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG