Hi Andrzej,

        I append some random code pointers / notes on hsqldb. In -theory- this
should be easy, since hsqldb by defualt stores it's data in a SQL dump - however
LibreOffice switched to an "optimised" binary store.

        That leaves the table formats as SQL - which we will need to import 
first,
and then introspect the produced tables (I suspect) in order to decode the 
binary
format. We need to use the parsed table / type information from that
import to walk the binary dump of the database: I don't think it's going
to be too difficult with a few unit tests about the place :-)

        I attach my (un-commented) and random code pointers from when I last
looked into doing that.

        Hope it helps :-)

                Michael.

-- 
[email protected]  <><, Pseudo Engineer, itinerant idiot
"Storage" property.

                aProperties.put( "storage_class_name",
                    ::rtl::OUString(  
"com.sun.star.sdbcx.comp.hsqldb.StorageAccess"  ) );
                aProperties.put( "fileaccess_class_name",
                    ::rtl::OUString(  
"com.sun.star.sdbcx.comp.hsqldb.StorageFileAccess"  ) );

,


                // JDBC driver and driver's classpath
                aProperties.put( "JavaDriverClass",
                    ::rtl::OUString(  "org.hsqldb.jdbcDriver"  ) );
                aProperties.put( "JavaDriverClassPath",
                    ::rtl::OUString(
#ifdef SYSTEM_HSQLDB
                        HSQLDB_JAR
                        " 
vnd.sun.star.expand:$BRAND_BASE_DIR/program/classes/sdbc_hsqldb.jar"
#else
                        
"vnd.sun.star.expand:$BRAND_BASE_DIR/program/classes/hsqldb.jar"
                        " 
vnd.sun.star.expand:$BRAND_BASE_DIR/program/classes/sdbc_hsqldb.jar"
#endif
                        ) );


connectivity/source/drivers/hsqldb/HDriver.cxx:
                + loads properties.


                ::rtl::OUString sConnPartURL = sSystemPath.copy( 0, ::std::max< 
sal_Int32 >( nIndex, sSystemPath.getLength() ) );
                ::rtl::OUString sKey = StorageContainer::registerStorage( 
xStorage, sConnPartURL );
                aProperties.put( "storage_key", sKey );
                aProperties.put( "storage_class_name",
                    ::rtl::OUString(  
"com.sun.star.sdbcx.comp.hsqldb.StorageAccess"  ) );
                aProperties.put( "fileaccess_class_name",
                    ::rtl::OUString(  
"com.sun.star.sdbcx.comp.hsqldb.StorageFileAccess"  ) );

        + so URL -> xStorage mapping ...



src/org/hsqldb/persist/DataFileCache.java:    protected String   backupFileName;
src/org/hsqldb/persist/DataFileCache.java:    // this flag is used externally 
to determine if a backup is required
src/org/hsqldb/persist/DataFileCache.java:        backupFileName = baseFileName 
+ ".backup";
src/org/hsqldb/persist/DataFileCache.java:     *  without backup.
src/org/hsqldb/persist/DataFileCache.java:                
fa.removeElement(backupFileName);
src/org/hsqldb/persist/DataFileCache.java:            backupFile();
src/org/hsqldb/persist/DataFileCache.java:     *  Saves the *.data file as 
compressed *.backup.
src/org/hsqldb/persist/DataFileCache.java:    void backupFile() throws 
IOException {
src/org/hsqldb/persist/DataFileCache.java:                
ZipUnzipFile.compressFile(fileName, backupFileName + ".new",
src/org/hsqldb/persist/DataFileCache.java:        if 
(fa.isStreamElement(backupFileName + ".new")) {
src/org/hsqldb/persist/DataFileCache.java:            
fa.removeElement(backupFileName);
src/org/hsqldb/persist/DataFileCache.java:            
fa.renameElement(backupFileName + ".new", backupFileName);
src/org/hsqldb/persist/DataFileCache.java:        
fa.removeElement(backupFileName);
src/org/hsqldb/persist/LockFile.java:            // safely checkpoint, backup 
and/or shut down that instance?  For
src/org/hsqldb/persist/LockFile.java:            // backup location using a 
globally unique file name and then do a



Stream file in ScaledRAFile.java ...

src/org/hsqldb/rowio/RowOutputBinary.java
        + writeDate, writeTime 

RowInputBase:
    public Object[] readData(int[] colTypes)
    throws IOException, HsqlException {


_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to