class DBQueries {

    public static <K, A> void createIndexTable(final String tableName, final Class<K> objectKeyClass, final Class<A> valueClass, final Connection connection){

        final String objectKeySQLiteType = DBUtils.getDBTypeForClass(objectKeyClass);
        final String objectValueSQLiteType = DBUtils.getDBTypeForClass(valueClass);

        final String sqlCreateTable = String.format(
                "CREATE TABLE IF NOT EXISTS cqtbl_%s (objectKey %s, value %s, PRIMARY KEY (objectKey, value)) WITHOUT ROWID;",
                tableName,
                objectKeySQLiteType,
                objectValueSQLiteType);

        Statement statement = null;

        try {
            statement = connection.createStatement();
            statement.executeUpdate(sqlCreateTable);
        }catch (SQLException e){
            throw new IllegalStateException("Unable to create index table: " + tableName, e);
        }finally {
            DBUtils.closeQuietly(statement);
        }
    }

}