I'm struggling to understand how can I represent following code by UML Sequence diagram:
What I already have:
Java code:
public static Connection getDbConnection() throws SQLException{
if (instanceOfDbConnect == null) {
instanceOfDbConnect = new DbConnection();
System.out.println(" Connection - - - - - - - - Trying to create DBConnection.");
}
try {
return DriverManager.getConnection(URL,user,password);
} catch (SQLException e) {
throw e;
}
}
How can I deal with this throwing SQLException if it's done in this way? It's seems to me that I should get a return message (throw e) from SQLException to DbConnection. But what is the sender message from DbConnection to SQLException?
Thank you very much for all your help!