Java Doc for ScriptWriterBase.java in  » Database-DBMS » hsql » org » hsqldb » scriptio » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » hsql » org.hsqldb.scriptio 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.hsqldb.scriptio.ScriptWriterBase

All known Subclasses:   org.hsqldb.scriptio.ScriptWriterText,  org.hsqldb.scriptio.ScriptWriterBinary,
ScriptWriterBase
abstract public class ScriptWriterBase implements Runnable(Code)
Handles all logging to file operations. A log consists of three blocks:

DDL BLOCK: definition of DB objects, users and rights at startup time
DATA BLOCK: all data for MEMORY tables at startup time
LOG BLOCK: SQL statements logged since startup or the last CHECKPOINT
The implementation of this class and its subclasses support the formats used for writing the data. In versions up to 1.7.2, this data is written to the *.script file for the database. Since 1.7.2 the data can also be written as binray in order to speed up shutdown and startup.

In 1.7.2, two separate files are used, one for the DDL + DATA BLOCK and the other for the LOG BLOCK.

A related use for this class is for saving a current snapshot of the database data to a user-defined file. This happens in the SHUTDOWN COMPACT process or done as a result of the SCRIPT command. In this case, the DATA block contains the CACHED table data as well.

DatabaseScriptReader and its subclasses read back the data at startup time.
author:
   fredt@users
version:
   1.8.0
since:
   1.7.2



Field Summary
final static  intINSERT
    
final static  intINSERT_WITH_SCHEMA
    
final public static  String[]LIST_SCRIPT_FORMATS
    
final public static  intSCRIPT_BINARY_172
    
final public static  intSCRIPT_TEXT_170
    
final public static  intSCRIPT_ZIPPED_BINARY_172
    
volatile  booleanbusyWriting
    
 longbyteCount
    
 SessioncurrentSession
    
 Databasedatabase
    
 OutputStreamfileStreamOut
    
volatile  booleanforceSync
    
 booleanincludeCachedData
    
 booleanisDump
    
volatile  booleanneedsSync
    
 FileAccess.FileSyncoutDescriptor
    
 StringoutFile
    
 HsqlNameschemaToLog
    
 inttableRowCount
    
protected volatile  intwriteDelay
    

Constructor Summary
 ScriptWriterBase()
    
 ScriptWriterBase(Database db, String file, boolean includeCachedData, boolean isNewFile, boolean isDump)
    

Method Summary
abstract protected  voidaddSessionId(Session session)
    
public  voidclose()
    
protected  voidfinishStream()
     This is not really useful in the current usage but may be if this class is used in a different way.
public  intgetWriteDelay()
    
abstract protected  voidinitBuffers()
    
public static  ScriptWriterBasenewScriptWriter(Database db, String file, boolean includeCachedData, boolean newFile, int scriptType)
    
protected  voidopenFile()
    
public  voidreopen()
    
public  voidrun()
    
public  voidsetWriteDelay(int delay)
    
public  longsize()
    
public  voidstart()
    
public  voidstop()
    
public synchronized  voidsync()
     Called internally or externally in write delay intervals.
public  voidwriteAll()
    
abstract public  voidwriteCommitStatement(Session session)
    
protected  voidwriteDDL()
    
abstract protected  voidwriteDataTerm()
    
abstract public  voidwriteDeleteStatement(Session session, Table table, Object[] data)
    
protected  voidwriteExistingData()
    
abstract public  voidwriteInsertStatement(Session session, Table table, Object[] data)
    
abstract public  voidwriteLogStatement(Session session, String s)
    
abstract  voidwriteRow(Session session, Table table, Object[] data)
    
abstract public  voidwriteSequenceStatement(Session session, NumberSequence seq)
    
protected  voidwriteSingleColumnResult(Result r)
    
protected  voidwriteTableInit(Table t)
    
protected  voidwriteTableTerm(Table t)
    

Field Detail
INSERT
final static int INSERT(Code)



INSERT_WITH_SCHEMA
final static int INSERT_WITH_SCHEMA(Code)



LIST_SCRIPT_FORMATS
final public static String[] LIST_SCRIPT_FORMATS(Code)



SCRIPT_BINARY_172
final public static int SCRIPT_BINARY_172(Code)



SCRIPT_TEXT_170
final public static int SCRIPT_TEXT_170(Code)



SCRIPT_ZIPPED_BINARY_172
final public static int SCRIPT_ZIPPED_BINARY_172(Code)



busyWriting
volatile boolean busyWriting(Code)



byteCount
long byteCount(Code)



currentSession
Session currentSession(Code)
the last schema for last sessionId



database
Database database(Code)



fileStreamOut
OutputStream fileStreamOut(Code)



forceSync
volatile boolean forceSync(Code)



includeCachedData
boolean includeCachedData(Code)



isDump
boolean isDump(Code)
this determines if the script is the normal script (false) used internally by the engine or a user-initiated snapshot of the DB (true)



needsSync
volatile boolean needsSync(Code)



outDescriptor
FileAccess.FileSync outDescriptor(Code)



outFile
String outFile(Code)



schemaToLog
HsqlName schemaToLog(Code)



tableRowCount
int tableRowCount(Code)



writeDelay
protected volatile int writeDelay(Code)




Constructor Detail
ScriptWriterBase
ScriptWriterBase()(Code)



ScriptWriterBase
ScriptWriterBase(Database db, String file, boolean includeCachedData, boolean isNewFile, boolean isDump) throws HsqlException(Code)




Method Detail
addSessionId
abstract protected void addSessionId(Session session) throws IOException(Code)



close
public void close() throws HsqlException(Code)



finishStream
protected void finishStream() throws IOException(Code)
This is not really useful in the current usage but may be if this class is used in a different way.



getWriteDelay
public int getWriteDelay()(Code)



initBuffers
abstract protected void initBuffers()(Code)



newScriptWriter
public static ScriptWriterBase newScriptWriter(Database db, String file, boolean includeCachedData, boolean newFile, int scriptType) throws HsqlException(Code)



openFile
protected void openFile() throws HsqlException(Code)
File is opened in append mode although in current usage the file never pre-exists



reopen
public void reopen() throws HsqlException(Code)



run
public void run()(Code)



setWriteDelay
public void setWriteDelay(int delay)(Code)



size
public long size()(Code)



start
public void start()(Code)



stop
public void stop()(Code)



sync
public synchronized void sync()(Code)
Called internally or externally in write delay intervals.



writeAll
public void writeAll() throws HsqlException(Code)



writeCommitStatement
abstract public void writeCommitStatement(Session session) throws HsqlException, IOException(Code)



writeDDL
protected void writeDDL() throws IOException, HsqlException(Code)



writeDataTerm
abstract protected void writeDataTerm() throws IOException(Code)



writeDeleteStatement
abstract public void writeDeleteStatement(Session session, Table table, Object[] data) throws HsqlException, IOException(Code)



writeExistingData
protected void writeExistingData() throws HsqlException, IOException(Code)



writeInsertStatement
abstract public void writeInsertStatement(Session session, Table table, Object[] data) throws HsqlException, IOException(Code)



writeLogStatement
abstract public void writeLogStatement(Session session, String s) throws IOException, HsqlException(Code)



writeRow
abstract void writeRow(Session session, Table table, Object[] data) throws HsqlException, IOException(Code)



writeSequenceStatement
abstract public void writeSequenceStatement(Session session, NumberSequence seq) throws HsqlException, IOException(Code)



writeSingleColumnResult
protected void writeSingleColumnResult(Result r) throws HsqlException, IOException(Code)



writeTableInit
protected void writeTableInit(Table t) throws HsqlException, IOException(Code)



writeTableTerm
protected void writeTableTerm(Table t) throws HsqlException, IOException(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.