Giter VIP home page Giter VIP logo

mintui9976 / asyncmysqlpoolhandler Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 2.0 139 KB

An simplify library to create jdbc pools via HikariCP. The Statement/PreparedStatement methods are performed asynchronously

License: MIT License

asychronous async async-functions asynchronous-programming asynchronous-tasks hikari-connection-pool hikari-datasource hikaricp jdbc jdbc-connector jdbc-database pool pool-allocator pool-manager pooling

asyncmysqlpoolhandler's Introduction

Hello, developers ๐Ÿฅฐ

About Me ๐Ÿ“ฃ

My name is Niklas and I work as a Software Engineer at Comwerk.de. I live in Germany and i'am 23 years old.

Languages / OS ๐Ÿšฉ and Tools ๐Ÿ”จ

OS ๐Ÿด๓ ฎ๓ ง๓ ฏ๓ ณ๓ ฟ

Languages ๐Ÿด๓ ฎ๓ ง๓ ฏ๓ ณ๓ ฟ and Tools ๐Ÿ”จ

Intellij Java Mysql MariaDB ApacheCassandra Maven Apache Gradle Docker

asyncmysqlpoolhandler's People

Contributors

azraanimating avatar kevin-gosa avatar mintui9976 avatar spark61 avatar

Stargazers

 avatar  avatar  avatar

asyncmysqlpoolhandler's Issues

SQL Injections

The code examples shown in the README are vulnerable to SQL Injections.
Please add save examples, so beginners are not just copying and pasting the examples and basically ripping their software.

:)

SLF4J error message

When using the api, SLF4J seems to through an exception every time at the beginning. After that every log is printed with red color in the console. All queries are executed though.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Mai 10, 2021 11:46:03 VORM. de.mint.asyncmysqlpoolhandler.mainservice.AsyncMySQLPoolHandler createMessage
INFORMATION: The pool was successfully created! [HIKARICP]
Mai 10, 2021 11:46:03 VORM. de.mint.asyncmysqlpoolhandler.mainservice.AsyncMySQLPoolHandler createMessage
INFORMATION: The pool was successfully closed! [HIKARICP]

The code producing the error above:

package util;

import de.mint.asyncmysqlpoolhandler.configservice.ConfigBuilder;
import de.mint.asyncmysqlpoolhandler.enumservice.EnumPoolFramework;
import de.mint.asyncmysqlpoolhandler.mainservice.AsyncMySQLPoolHandler;
import java.util.concurrent.CompletableFuture;
import org.intellij.lang.annotations.Language;

public class DatabaseUtil {

  private static final AsyncMySQLPoolHandler asyncMySQLPoolHandler =
      new AsyncMySQLPoolHandler(
          "localhost",
          3306,
          "root",
          "",
          "test",
          EnumPoolFramework.HIKARICP,
          ConfigBuilder.getConfigBuilder().build());

  public static void connect() {
    DatabaseUtil.asyncMySQLPoolHandler.openPool();
  }

  public static CompletableFuture<Void> update(@Language("MySQL") final String sql) {
    return DatabaseUtil.asyncMySQLPoolHandler.executeUpdateAsync(sql);
  }

  public static void disconnect() {
    DatabaseUtil.asyncMySQLPoolHandler.closePool();
  }

  public static void setup() {
    DatabaseUtil.update("CREATE TABLE IF NOT EXISTS `temp` (`first` INT, `second` VARCHAR(16));")
        .join(); // so the connection only closes if the query got executed
  }

  public static void main(final String[] args) {
    DatabaseUtil.connect();
    DatabaseUtil.setup();
    DatabaseUtil.disconnect();
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.