[SQLiteJDBC] Fwd: malformed database schema - no such table
Adam B
adamb at videx.com
Mon Oct 24 13:46:22 EDT 2011
My guess is that you have a corrupt database. Do a google search on "malformed database schema". You might also want to execute "PRAGMA integrity_check" from a sqlite command line.
You can prove that your code is not the problem be creating a blank database with only the TEST_PERSON table in it.
On 10/24/2011 08:51 AM, aramati at web.de wrote:
> ---------- Forwarded message ----------
> From:<aramati at web.de>
> Date: 2011/10/24
> Subject: malformed database schema - no such table
> To: sqlite-users at sqlite.org
>
>
> Hello @all!
>
> I have a problem which I cannot solve:
>
> When trying to run a statement on my running db via JDBC I get the following
> error:
>
> java.sql.SQLException: malformed database schema (B_TEST_IDX) - no such
> table: main.BREATHS
> at org.sqlite.DB.throwex(DB.java:288)
> at org.sqlite.NativeDB.prepare(Native Method)
> at org.sqlite.DB.prepare(DB.java:114)
> at org.sqlite.Stmt.executeQuery(Stmt.java:89)
> at eu.aceos.aeroscan.db.DBDAO.getPersons(DBDAO.java:74)
> at eu.aceos.aeroscan.db.DBDAO.main(DBDAO.java:258)
> Exception in thread "main" java.lang.NullPointerException
> at eu.aceos.aeroscan.db.DBDAO.getPersons(DBDAO.java:83)
> at eu.aceos.aeroscan.db.DBDAO.main(DBDAO.java:258)
>
> The table has nothing to do with my request, as you will see:
>
> public class DBDAO implements DBInterface {
>
> private static Connection connection = null;
>
> //filename ist derzeit der path + filename, derzeit
> //C:\\develop\\aeroscan.sqlite
> public static Connection connect(String filename) {
>
> if (connection == null) {
>
> String url = "jdbc:sqlite:"
> // + SettingsManager.getInstance().getDBDirectory()
> + filename;
>
> try {
> Class.forName("org.sqlite.JDBC"); // Treiber laden
> } catch (Exception e) {
> //todo: logger, dass der Treiber nicht geladen werden konnte
> return null;
> }
>
> // Verbindung zur Datenbank öffnen (unter Verwendung der
> // Konstanten, die oben definiert wurden)
> try {
> // todo: url noch das user und passwd zufügen!
> connection = DriverManager.getConnection(url);
>
> } catch (SQLException e) {
>
> e.printStackTrace();
> return null;
> }
> }
> return connection;
> }
>
>
>
> public ArrayList<TestPerson> getPersons() {
> ResultSet rs = null;
> // ein ganz normales SQL-Statement wird als String angelengt
> String query = "SELECT * FROM TEST_PERSON;";
> // Abfrage durchfuehren und im Fehlerfall eine Meldung ausgeben
> try {
> Statement stmt = connection.createStatement();
> rs = stmt.executeQuery(query); // Abfrage ausfuehren
> } catch (SQLException e) {
> e.printStackTrace();
> } catch (NullPointerException e) {
> e.printStackTrace();
> }
>
>
> try {
> while (rs.next()) {
> System.out.println(rs.getString("NAME")); // NAME ist
> Spaltenbezeichnung
> }
> } catch (SQLException e) {
> e.printStackTrace();
> }
>
> return new ArrayList<TestPerson>();
> }
>
> }
>
> When I drop the table BREATHS, which is actually existing, nothing changes.
> All that is happening is that a cascade of these sql-errors appear following
> the next of tables, then the next, ...
>
> What is wrong, here?
>
> Thanks in advance,
>
> Tamara
> _______________________________________________
> SQLiteJDBC mailing list
> SQLiteJDBC at lists.hcoop.net
> https://lists.hcoop.net/listinfo/sqlitejdbc
Videx, Inc. | 1105 NE Circle Blvd. | Corvallis, OR 97330 | (541) 738-5500
This email is intended only for the addressee(s) and may include material that is privileged, confidential, and protected from disclosure. No contract is intended. ©2011 Videx, Inc.
More information about the SQLiteJDBC
mailing list