About
Make you life easier working with database! This library will help you to handle MySQL or SQLite databases in a simple way and with less code.
Examples
Connecting to database
Without API
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection connection = DriverManager.getConnection("jdbc:mysql://" + url + "/" + name + "?user=" + user + "&password=" + pass + "&autoReconnect=true&useSSL=false");
} catch (Exception ex) {...}With API
MySQL mysql = new MySQL(url, name, user, pass);
mysql.openConnection();Executing an update
Without API
Statement statement = null;
try {
if (connection.isClosed()) {...};
statement = connection.createStatement();
statement.executeUpdate(sql);
} catch (SQLException ex) {...}With API
mysql.executeUpdate(sql);Features
- Simple and easy to use
- MySQL and SQLite
- Prepare and store statements
- Manual commit / rollback ability
- JavaDocs and Source code included
Getting started
For example we need to work with MySQL. First, we need to create MySQL object and open a connection:
MySQL mysql = new MySQL("127.0.0.1:3306", "name", "user", "password");
mysql.openConnection();
Then we can execute any update or query:
ResultSet set = mysql.executeQuery("SELECT COUNT(*) FROM database");
No needs to check if ResultSet empty etc. Method returns null if there are no entries.
Library also gives you ability to prepare and store statements to execute it many times in future. Firstly we create prepared statement:
mysql.prepareStatement("mySt", "SELECT * FROM database WHERE col = ?");
So, now we can execute it, replaing '?' by variable:
mysql.executePreparedQuery("mySt", "value");Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta