SQLITE JDBC Adapter for SAP PI 7.30

  • Posted on: 23 February 2013
  • By: markus.wilhelm

To be able to use the SQLITE Jdbc class within a SAP PI 7.30 JDBC Adapter (sender or receiver) you must mdify the Jdbc class a little.
SQLITE Homepage: http://www.sqlite.org/
SQLITE JDBC Adapter from Xerial: http://www.xerial.org/trac/Xerial/wiki/SQLiteJDBC

The default jdbc classes for SQLITE need native libraries being available on the host where the jdbc class is used. Xerial implemented the SQLITE libraries within their SQLITE jdbc class but you must tell the class if you want to use native or build in Java SQLITE libraries. Within the calling code you may set the variable sqlite.purejava.

Example:

public class sample
{
  public static void main(String[] args) throws ClassNotFoundException
  {
    // load the sqlite-JDBC driver using the current class loader
    System.setProperty("sqlite.purejava", "true");
    Class.forName("org.sqlite.JDBC");
...
}

This is not possible within SAP PI, so I changed the jdbc jar to allways use the build in java library for SQLITE. I changed the function getPureJavaFlag file SQLiteJDBCLoader.java in the following way. You may download the jar file here.

package org.sqlite;
 
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
...
public class SQLiteJDBCLoader
{
...
    static boolean getPureJavaFlag() {
        //return Boolean.parseBoolean(System.getProperty("sqlite.purejava", "false"));
        return true;
    }
...
}
This now enables you to use SQLITE JDBC Adapter within SAP PI 7.30 as all other jdbc database connection:
- JDBC Driver: org.sqlite.JDBC
- Connection: jdbc:sqlite:/usr/sap/trans/interfaces/example.db
- leave username and password empty