Commons/src/main/java/eu/univento/commons/database/MySQL.java

26 lines
790 B
Java

/*
* Copyright (c) 2017 univento.eu - All rights reserved
* You are not allowed to use, distribute or modify this code
*/
package eu.univento.commons.database;
import eu.univento.commons.Commons;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.asyncsql.AsyncSQLClient;
import io.vertx.ext.asyncsql.MySQLClient;
import lombok.Getter;
/**
* @author joethei
* @version 1.2
*/
public class MySQL {
@Getter private AsyncSQLClient client;
public MySQL(String hostname, int port, String database, String username, String password) {
client = MySQLClient.createShared(Commons.getCommons().getVertx(),
new JsonObject().put("host", hostname).put("port", port).put("username", username).put("password", password).put("database", database));
}
}