'How can I supress MariaDB JDBC warnings?

Having the following code

try {
    Connection connection = DriverManager.getConnection(connectionModel.connectionString());
    return true;
} catch (SQLException ignored) {}
return false;

I'm getting this warning when I put the right server:port but wrong user

[ WARN] (AWT-EventQueue-0) Error: 1045-28000: Access denied for user '1234'@'192.168.0.2' (using password: YES)

I would like to suppress every kind of warnings as I'm just checking if the connection was successful or not.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source