Database interface


This is an interface between different database adapters. In few words you can use the same code between different db sources. It currently supports SQLite and MySQL (hikari cp).


Maven Repo

  <!-- Use /releases if you want a stable version -->
public class SomeClass {

    public static void main(String[] args) {

        // database interface
        DatabaseAdapter databaseAdapter = new SQLiteAdapter("localDatabase.db");
        // or MySQL
        databaseAdapter = new HikariAdapter(poolName, poolSize, maxLifeTime, host, port, dbName, username, password, verifyCertificate, useSSL);

        // columns
        UUIDColumn primaryKey = new UUIDColumn("player_uuid", null);
        IntegerColumn killsColumn = new IntegerColumn("kills", 2, 8);

        // table builder
        TableBuilder player_stats_builder = new TableBuilder("player_stats", primaryKey);

        // table variable
        Table player_stats =;

        // create table on db
        databaseAdapter.createTable(player_stats, true);

        // uuid for testing
        UUID testUUID = UUID.fromString("c252c59e-dd51-44f6-9697-89ac6a88e6a1");

        // insert
        List<ColumnValue<?>> values = new ArrayList<>();
        values.add(new SimpleValue<>(primaryKey, testUUID));
        values.add(new SimpleValue<>(killsColumn, 4));
        databaseAdapter.insert(player_stats, values);

        // get data from db
        int kills =, player_stats, new EqualsOperator<>(primaryKey, testUUID));

        System.out.println("Kills: " + kills);