Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


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.

-- 
michael.meeks@suse.com  <><, 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 {



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.