import java.sql.DriverManager;
import java.sql.SQLException;


public class BugConnectionErrorCode {

    public static void main (String args[]) {
        try {
            DriverManager.getConnection("jdbc:mariadb://localhost:3306/testdb","foo","bar").createStatement();
        } catch (SQLException e) {
            System.out.println("MariaDB Exception: " + e);
            System.out.println("MariaDB ErrorCode: " + e.getErrorCode());
            System.out.println("MariaDB SQLState: " + e.getSQLState());
        }

        System.out.println("-------------------------------------------------------------------------");

        try {
            DriverManager.getConnection("jdbc:mysql://localhost:3306/testdb","foo","bar").createStatement();
        } catch (SQLException e) {
            System.out.println("MySQL Exception: " + e);
            System.out.println("MySQL ErrorCode: " + e.getErrorCode());
            System.out.println("MySQL SQLState: " + e.getSQLState());
        }
    }
}
