mintui9976 / asyncmysqlpoolhandler Goto Github PK
View Code? Open in Web Editor NEWAn simplify library to create jdbc pools via HikariCP. The Statement/PreparedStatement methods are performed asynchronously
License: MIT License
An simplify library to create jdbc pools via HikariCP. The Statement/PreparedStatement methods are performed asynchronously
License: MIT License
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: 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]
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();
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.