-
Notifications
You must be signed in to change notification settings - Fork 1
Java
Oleh Astappiev edited this page Oct 16, 2023
·
1 revision
Use the auto close feature to make sure that statements are closed:
try(PreparedStatement select = learnweb.getConnection().prepareStatement("SELECT ...");)
{
select.setInt(1, groupId);
ResultSet rs = select.executeQuery();
while(rs.next())
....
}
Try without catch in this case. Because most errors must be catched in the beans to allow notification of users.