sqlite on iSeries

77 views
Skip to first unread message

c.sta...@gmail.com

unread,
Jul 21, 2016, 9:14:10 AM7/21/16
to Xerial
I've changed the old logging system for our application server to SQLite.
Under Windows it runs perfectly fine but on our iSeries it can't establish a connection to the database file.

Any advice?

Stacktrace

java.sql.SQLException: Error opening connection
        at org.sqlite.core.CoreConnection.open(CoreConnection.java:215)
        at org.sqlite.core.CoreConnection.<init>(CoreConnection.java:76)
        at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:24)
        at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:23)
        at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:45)
        at org.sqlite.JDBC.createConnection(JDBC.java:114)
        at org.sqlite.JDBC.connect(JDBC.java:88)
        at java.sql.DriverManager.getConnection(DriverManager.java:590)
        at java.sql.DriverManager.getConnection(DriverManager.java:201)
        at com.qsc.framework.system.LogService.connectDB(LogService.java:94)

Code

Properties props = new Properties();
props
.put("user", DB_USER);
props
.put("password", DB_PWD);
props
.put("journal_mode", "TRUNCATE");


Class.forName("org.sqlite.JDBC");
return DriverManager.getConnection("jdbc:sqlite:/qs1/server/logs/log.sqlite", props);
 
Additional Infos
  • sqlite-jdbc-3.8.11.2
  • iSeries is using Java "IBM J9 VM" version 1.0
  • other jdbc drivers are working fine (we are using 2 different DB2 drivers to connect to our application database)

c.sta...@gmail.com

unread,
Jul 21, 2016, 10:25:28 AM7/21/16
to Xerial
Edit: Found out that the main exception has a second one attached to it...
So it seems the driver isn't compatible with OS400.
Any other drivers I could use?

Second Stacktrace:

> java.lang.Exception: No native library is found for os.name=OS400 and os.arch=ppc
> at
> org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:284)
> at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:65)
> at org.sqlite.core.NativeDB.load(NativeDB.java:53)
> at org.sqlite.core.CoreConnection.open(CoreConnection.java:211)

James Moger

unread,
Jul 22, 2016, 10:04:38 AM7/22/16
to xer...@googlegroups.com
SQLite, being a native library, requires native code to be compiled for each target architecture. You've discovered that your target OS is not supported.

The Xerial driver is the most complete JDBC driver for SQLite - but that isn't to say it is complete.  It's too bad that the JRE doesn't ship with SQLite built-in. Though even if it did I'm not sure it would help you on J9. It's been a few years since I've needed to use that VM.

Your choices are:

1. Compile the binaries yourself
2. Switch to a pure Java engine like HSQL or H2
3. Restore your original logging solution

HTH,
-J

Reply all
Reply to author
Forward
0 new messages