267268269270271272273274275276
ResultSet result = statement.executeQuery(); while (result.next()) { resources.add(getResourceFromResult(result)); } } catch (SQLException e) { throw new DAOException(); } return resources; }
284285286287288289290291292
statement.setInt(1, resource.getResourceID()); statement.setInt(2, user.getUserID()); statement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); throw new DAOException(); } }
302303304305306307308309310
320321322323324325326327328
335336337338339340341342
.prepareStatement(command); statement.setInt(1, resource.getResourceID()); statement.setInt(2, group.getGroupID()); statement.executeUpdate(); } catch (SQLException e) { throw new DAOException(); } }
365366367368369370371372373374
252627282930313233
} } public static Connection getConnection() throws DAOException { if (connection == null) { throw new DAOException(); } return connection; }
293031323334353637
project = getProjectFromResult(result); } else { throw new ProjectNotFoundException(); } } catch (SQLException e) { throw new DAOException(); } return project; }
495051525354555657
108109110111112113114115
PreparedStatement statement = JdbcConnection.getConnection() .prepareStatement(command); statement.setInt(1, project.getProjectID()); statement.executeUpdate(); } catch (SQLException e) { throw new DAOException(); } }