
Modrinth · Minecraft mod
Database Utils
A simple mod for developers to make database usage easier
Quick answer
Which Database Utils release should I use?
Database Utils 1.0.0+26.1 targets 26.1, 26.1.1, 26.1.2 with Fabric. Installation on the client is optional. Installation on the dedicated server is optional. No extra mods listed for this file.
Where it goes
Is Database Utils required on the client, server, or both?
Installation on the client is optional. Installation on the dedicated server is optional.
The source marks this as usable on both the client and server.
What else does Database Utils 1.0.0+26.1 need?
1.0.0+26.1. Change the file and its required mods may change too.
This file does not list any required mods. Do not add a library just because a different file uses it.
This file does not list any required or optional mods.
Before you install it
Add Database Utils without breaking your instance.
Built for Database Utils 1.0.0+26.1. Pick another file and the loader, install side or required mods may change.
- 01
Stick to this file
Use 1.0.0+26.1. It targets 26.1, 26.1.1, 26.1.2 with Fabric; another release may have different loader, side or dependency requirements.
- 02
Bring the mods it needs
This file does not list any required mods. Do not add a library just because a different file uses it.
- 03
Put it on the correct side
Installation on the client is optional. Installation on the dedicated server is optional.
- 04
Pick the file you checked
Use the “Get this file” button beside 1.0.0+26.1. It opens that exact file at the source.
About this project
What does Database Utils add?
Database Utils
🔎 Explanations
This mod includes some utilities for working with databases.
The most popular connectors are included directly in the mod JAR, which avoids having to import them into each mod and helps reduce the overall size of your projects.
To import this library, you must add the following to your build.gradle file.
repositories {
maven { url "https://api.modrinth.com/maven" }
}
dependencies {
implementation "maven.modrinth:database-utils:1.0.0"
}
🖥️ Usage
Configuration is managed by this library. By using the following line, a .properties file is automatically created (if it does not already exist) and loaded from the config folder.
Config config = new Config(MOD_ID);
In this example, the file will be named MOD_ID.properties.
Here is an example configuration file.
storage=postgres
host=127.0.0.1
port=5432
database=minecraft_db
user=user
password=password
| Key | Description |
|---|---|
| storage | Database type. Must be one of: postgres, mysql, mariadb, sqlite, or test. |
| host | IP address or hostname of the database server |
| port | Port used by the database server. |
| database | Name of the database. |
| user | User used to connect to the database. |
| password | Password of the user. |
Then, you need to define your own class MyCustomDB, which extends DatabaseQueries.
This class is intended to contain all SQL related methods.
In this context, you have access to some method from DatabaseQueries, such as getType, which help you create an implementation compatible with multiple databases.
public class MyCustomDB extends DatabaseQueries {
public MyCustomDB(Database db) {
super(db);
}
@Override
public void init() {
try (Connection connection = getConnection()) {
/* ... */
} catch (SQLException | DatabaseLinkException e) {
LOGGER.error("Unable to initialize: {}", e.getMessage());
}
}
/* other methods */
public void someMethod() {
/* ... */
}
}
You will also need to create a database instance. This is where the Config object is used. The following code snippet retrieves the database defined in the configuration and initializes your DatabaseQueries implementation.
Database database = DatabaseUtils.getDatabase(config);
MyCustomDB custom = new MyCustomDB(database);
You can now call any query defined in your DatabaseQueries implementation through your custom instance.
custom.someMethod();
Project description from Modrinth.
Pick your setup
Database Utils by Minecraft version and loader
Choose the version and loader you play, then open the matching release.
26.1.2
1 loader build26.1.1
1 loader build26.1
1 loader build1.21.11
1 loader build1.21.10
1 loader build1.21.9
1 loader build1.21.8
1 loader build1.21.7
1 loader build1.21.6
1 loader build1.21.5
1 loader build1.21.4
1 loader buildShowing the newest 12 of 23 game versions. Older files are in the list below.
Check the dependencies, then try the file in a copied instance before changing a world you care about.
Recent files
Database Utils versions and loaders
1.0.0+26.1
database-utils-1.0.0+26.1.jar
14 Jul 2026
1.0.0
database-utils-1.0.0.jar
29 Nov 2025
Looking for an older file? The official Modrinth project page is in Resources.