oh well, we shall hope this opens up a database and doesn't cause my computer to evaporate
This commit is contained in:
parent
572b8e9783
commit
3f579091f4
3 changed files with 29 additions and 0 deletions
|
@ -14,6 +14,8 @@ minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
|
|||
quilt_mappings = { module = "org.quiltmc:quilt-mappings", version.ref = "quilt_mappings" }
|
||||
quilt_loader = { module = "org.quiltmc:quilt-loader", version.ref = "quilt_loader" }
|
||||
|
||||
h2 = { module = "com.h2database:h2" }
|
||||
|
||||
quilt_standard_libraries = { module = "org.quiltmc:qsl", version.ref = "quilt_standard_libraries" }
|
||||
quilted_fabric_api = { module = "org.quiltmc.quilted-fabric-api:quilted-fabric-api", version.ref = "quilted_fabric_api" }
|
||||
quilted_fabric_api_deprecated = { module = "org.quiltmc.quilted-fabric-api:quilted-fabric-api-deprecated", version.ref = "quilted_fabric_api" }
|
||||
|
|
|
@ -14,6 +14,7 @@ public class MicoMc implements ModInitializer {
|
|||
// It is considered best practice to use your mod name as the logger's name.
|
||||
// That way, it's clear which mod wrote info, warnings, and errors.
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger("MicoMc");
|
||||
public static final Storage STORAGE = new Storage();
|
||||
|
||||
@Override
|
||||
public void onInitialize(ModContainer mod) {
|
||||
|
|
26
src/main/java/xyz/minecommune/micomc/Storage.java
Normal file
26
src/main/java/xyz/minecommune/micomc/Storage.java
Normal file
|
@ -0,0 +1,26 @@
|
|||
package xyz.minecommune.micomc;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class Storage {
|
||||
|
||||
public Connection connection;
|
||||
|
||||
public Storage() {
|
||||
String jdbcURL = "jdbc:h2:~/test";
|
||||
String username = "";
|
||||
String password = "";
|
||||
try {
|
||||
this.connection = DriverManager.getConnection(
|
||||
jdbcURL,
|
||||
username,
|
||||
password
|
||||
);
|
||||
} catch (Exception e) {}
|
||||
MicoMc.LOGGER.debug("Connected to H2 embedded database.");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue