<dependencies>
<dependency>
<groupId>ru.zoommax</groupId>
<artifactId>DBEngine</artifactId>
<version>VERSION</version>
</dependency>
</dependencies>
implementation 'ru.zoommax:DBEngine:VERSION'
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);
}
}
}
}
}
v1.0:
- SQLite;
- MySQL;
All databases must work locally.
Plans:
- add support for remote databases;
- add support for other types of databases;