Skip to content

A easy way to use SQL on Java. Without creating long queries.

Notifications You must be signed in to change notification settings

samcefalo/sql-provider-hikari

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sql-provider-hikari

A easy way to use SQL on Java. Create new connections and easy queries.

Creating database-connections

SqlLite

Database database = Provider.getInstance().submitSqlLite(path);

MySql

Database database = Provider.getInstance().submitMySql(host, url, user, password);

HikariCP

Database database = Provider.getInstance().submitHikari(host, url, user, password);

Creating tables

Database#update(new TableQuery()
      .name("users", true)
      .fields(new TableField()
              .name("id")
              .type("int")
              .size(8)
              .autoIncrement())
      .primary("id"));

Insert Data

        database.updateSync(new Query().insert("users", 1, "eike"));

Get Data

        List<Object> data = database.querySync(new Query()
                .select("id", "name")
                .from("users"));

Delete Data

        database.querySync(new Query()
                .delete()
                .from("users")
                .where("id", 1));

And others examples you may get on QueriesTest.java file, on test folder.

About

A easy way to use SQL on Java. Without creating long queries.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%