Given the snippet below, what will it print if the database is connected successfully?

Last Updated :
Discuss
Comments

Given the snippet below, what will it print if the database is connected successfully?

Java
Connection con = DriverManager.getConnection(dbURL, user, pass);
if (con != null) {
    System.out.println("Connection Successful");
}

Connection Failed

Exception Thrown

Connection Successful

No Output


Share your thoughts in the comments