Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Currently trying to add H2 Database support with my mod. I've shaded the h2 database engine in my build.gradle like so:

shadowJar {
    dependencies {
        include dependency("org.json:json:20180813"),
        include dependency("com.h2database:h2:1.0.60")
    }
    relocate("org.json", "shaded.org.json")
    relocate("com.h2database","shaded.com.h2database")
}

...
  
reobf {
    shadowJar {
        mappingType = 'SEARGE'
    }
}

 

Issue is, everytime I attempt to establish a connection using my H2Connection class like so:

H2Connection db = new H2Connection("jdbc:h2:D:/H2db/test/test", "admin", "password");

 

I get an error saying: java.sql.SQLException: No suitable driver found for jdbc:h2:D:/H2db/test/test

Anyone know whats up? Am I doing this right?

 

This is my H2Connectionclass:

public class H2Connection {
    private Connection conn;

    public H2Connection() {}
    public H2Connection(String url, String user, String pass) throws SQLException, ClassNotFoundException {
        connect(url, user, pass);
    }
    public void connect(String url, String user, String pass) throws SQLException, ClassNotFoundException {
        conn = DriverManager.getConnection(url,user,pass);
    }
    public ResultSet query(String query) throws SQLException {
        return conn.createStatement().executeQuery(query);
    }
}

 

Edited by ratquaza

  • Author

Realised my build.gradle was missing some things that lead to it not properly shading. It's fixed now!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.