ps.setInt(3, resourceId);
try {
ResultSet rs = ps.executeQuery();
try {
if (rs.next()) {
return new DefaultFavorite(rs.getInt("favorite_id"), type, user == null ? null : user.getPrincipalName(), rs.getInt("favorite_key"));
}
} finally {
rs.close();
}
} finally {