Java – SQLException

SQLException: Thrown when there is an error in accessing a database.
Example:

import java.sql.*;
try {
Connection con = DriverManager.getConnection("jdbc:invalid:url");
} catch (SQLException e) {
System.out.println("Caught SQLException: " + e.getMessage());
}

No images available.