Is the jdbc driver supposed to throw an exception when it tries to
access a database file that doesn't exist with in the method
DriverManager.getConnection(dbUrlString)?
I have stepped through the driver source and in Conn.java the
exception is caught, but no there is action associated with the
exception. Here is the relative code:
Class nativedb = Class.forName("org.sqlite.NativeDB");
if (((Boolean)nativedb.getDeclaredMethod("load", null)
.invoke(null, null)).booleanValue())
db = (DB)nativedb.newInstance();
} catch (Exception e) { } // fall through to nested library
// load nested library
if (db == null) {
try {
db =
(DB)Class.forName("org.sqlite.NestedDB").newInstance();
} catch (Exception e) {
throw new SQLException("no SQLite library found");
}
}
I have tried with version 43 and 47 native and pure. All produce the
same results. No exception is thrown and the non-existent file is
created. Is this the expected behavior for the driver? What am I
missing here?
The code I used for testing is the sample in the Getting Started
section of the driver page. I replaced test.db with a non-existent
file path.
Thanks,
Dima
Any ideas?
--~--~---------~--~----~------------~-------~--~----~
Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en
To unsubscribe, send email to [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---