Domanda

I'm trying to use SQLData with a Sqlite database, but get an exception here:

    private SQLDataReaderTest() {
    try {
        Class.forName("org.sqlite.JDBC");
        connection = DriverManager.getConnection("jdbc:sqlite:ressources/data/TestDB.rdb");

        java.util.Map map = connection.getTypeMap();
        map.put("TestDB.customer", Class.forName("SQLDataTest"));
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    } catch (SQLException e) {
        e.printStackTrace();
    }
}

Testing brings up:

java.sql.SQLException: not yet implemented
at org.sqlite.Conn.getTypeMap(Conn.java:297)
at de.devision.model.SQLDataReaderTest.<init>(SQLDataReaderTest.java:20)
at de.devision.model.SQLDataReaderTest.getInstance(SQLDataReaderTest.java:31)

Line 20 is the connection.getTypeMap() part. The connection etc. do work fine, as everything works without the UDT.

Can anybody see what I'm doing wrong?

È stato utile?

Soluzione

The exception states that the sqlite driver does not implement this feature (getTypeMap()). You are doing nothing wrong, you are just using a database and or driver which does not (yet) support this.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top