walterDurin / sqlite-jdbc

Automatically exported from code.google.com/p/sqlite-jdbc
Apache License 2.0
0 stars 0 forks source link

SQLITE_NOTADB : file is encrypted when setting sqlite.purejava to true #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Create a Java class "Sqlite_notadb" with the following content and run it:

{{{
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Sqlite_notadb {
    public static void main(String[] args) throws ClassNotFoundException,
            SQLException {
        System.setProperty("sqlite.purejava", "true");
        Class.forName("org.sqlite.JDBC");
        Connection connection = DriverManager.getConnection("jdbc:sqlite:AddressBook.sqlitedb");
        Statement statement = connection.createStatement();
        ResultSet rs = statement.executeQuery("select first, last from ABPerson where first is not null order by first");
    }
}
}}}

What is the expected output? What do you see instead?
Expected: No error.
Instead: {{{java.sql.SQLException: [SQLITE_NOTADB]  File opened that is not a 
database file (file is encrypted or is not a database)}}}

What version of the product are you using? On what operating system?
sqlite-jdbc-3.7.2.jar or
sqlite-jdbc-3.7.6.3-20110609.081603-3.jar
Windows XP SP3
JDK 1.7.0_04, Eclipse set to compliance 'J2SE-1.5'

Please provide any additional information below.
Supposed reason of error:
"Beginning with version 3.7.0, a new 'Write-Ahead Log' option (hereafter 
referred to as "WAL") is available."
[...]
"Thus, if an older version of SQLite attempts to connect to an SQLite database 
that is operating in WAL mode, it will report an error along the lines of 'file 
is encrypted or is not a database'."

Original issue reported on code.google.com by germanic...@googlemail.com on 3 Jul 2012 at 8:02

GoogleCodeExporter commented 9 years ago
Wiki syntax for code blocks was not applied 
(http://code.google.com/p/support/wiki/WikiSyntax#Code) - {{{Code}}}

Original comment by germanic...@googlemail.com on 3 Jul 2012 at 8:04

GoogleCodeExporter commented 9 years ago
Forgot citation source for additional info: http://www.sqlite.org/wal.html

Original comment by germanic...@googlemail.com on 3 Jul 2012 at 8:06

GoogleCodeExporter commented 9 years ago
Forgot another thing regarding reproducing the problem: One needs a file 
"AddressBook.sqlitedb" which is WAL-enabled placed in the same directory as the 
class. The SQL-query can be arbitrary but must be valid, for example "select 
nothing from notexistingtable".

Original comment by germanic...@googlemail.com on 3 Jul 2012 at 9:35

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Replied to on bitbucket: https://bitbucket.org/xerial/sqlite-jdbc/issue/8

Original comment by Grace.Ba...@gmail.com on 10 Sep 2012 at 6:16

GoogleCodeExporter commented 9 years ago

Original comment by Grace.Ba...@gmail.com on 12 Sep 2012 at 2:54