AnantLabs / xerial

Automatically exported from code.google.com/p/xerial
0 stars 0 forks source link

Newest snapshot sqlite-jdbc-3.6.23.1.jar does not properly support the backup/restore functions #71

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. try to use the BackupCommand or RestoreCommand execute(DB) method.

What is the expected output? What do you see instead?
Db is not visible therefore cannot be passed to the method.

What version of the product are you using? On what operating system?
sqlite-jdbc-3.6.23.1.jar windows

Please provide any additional information below.
I was able to modify the methods using different constructor.

See ExtendedCommand.java

Under BackupCommand:
        public void execute(Connection con) throws SQLException
        { 
            if (con == null || !(con instanceof Conn))
                throw new SQLException("connection must be to an SQLite 
db");
            if (con.isClosed())
                throw new SQLException("connection closed");
            conn = (Conn)con;
            db = conn.db();
            db.backup(srcDB, destFile, null);
        }

Under RestoreCommand:
        public void execute(Connection con) throws SQLException
        { 
            if (con == null || !(con instanceof Conn))
                throw new SQLException("connection must be to an SQLite 
db");
            if (con.isClosed())
                throw new SQLException("connection closed");
            conn = (Conn)con;
            db = conn.db();
            db.restore(targetDB, srcFile, null);
        }

Original issue reported on code.google.com by crosenb...@gmail.com on 26 May 2010 at 7:15

GoogleCodeExporter commented 9 years ago
Thanks for the improvement. These methods would be useful when the user knows 
that
the connection is for SQLite databases. 

http://code.google.com/p/xerial/source/browse/src/main/java/org/sqlite/ExtendedC
ommand.java?repo=sqlite

Original comment by taroleo on 26 May 2010 at 11:53