Code: Select all
try(Connection conn = DatabaseConnection.getConnection();
Statement stmt = conn.createStatement();
PreparedStatement pstmt = conn.prepareStatement()) // is this allowed?
{
}
catch (SQLException e){
e.printStackTrace();
}
Ich möchte nicht für jeden neuen Verbindungstyp einen neuen Try-Catch-Block schreiben.
Mobile version