Skip to content

ZooMMaX/DBEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DBEngine

GitHub license GitHub issues GitHub Workflow Status GitHub Workflow Status Maven Central

Dependencies

dependency maven

Maven Central

<dependencies>
    <dependency>
        <groupId>ru.zoommax</groupId>
        <artifactId>DBEngine</artifactId>
        <version>VERSION</version>
    </dependency>
</dependencies>

dependency gradle

Maven Central

implementation 'ru.zoommax:DBEngine:VERSION'

How to use

import ru.zoommax.DBEngine.api.DB;
import ru.zoommax.DBEngine.api.DBType;
import ru.zoommax.DBEngine.core.DBInit;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class TestMain {
    public static void main(String[] args) {
        new DBInit().init(DBType.SQLITE, "test");
        boolean ok = new DB(DBType.SQLITE, "CREATE TABLE IF NOT EXISTS test(t TEXT, s TEXT);", null).execSQL();
        if (ok) {
            List<Object> ins = new ArrayList<>();
            ins.add("te");
            ins.add("st");
            ok = new DB(DBType.SQLITE, "INSERT INTO test(t, s) VALUES(?, ?);", ins).execSQL();
            if (ok) {
                ArrayList<HashMap<String, Object>> result = new DB(DBType.SQLITE, "SELECT * FROM test;", null).getMultiResultSet();
                for (HashMap<String, Object> hashMap : result) {
                    String s = (String) hashMap.get("s");
                    String t = (String) hashMap.get("t");
                    System.out.println(t + s);
                }
            }
        }
    }
}

Supports databases

v1.0:

  • SQLite;
  • MySQL;

Whitepaper

All databases must work locally.

Plans:

  • add support for remote databases;
  • add support for other types of databases;

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages