public static int addStudy(Study study) {

    ConnectionPool pool = ConnectionPool.getInstance();
    Connection connection = pool.getConnection();
    PreparedStatement ps = null;

    String query =
        "INSERT INTO study (name,description,creatorEmail, dateCreated, "
            + "question, imageURL, requestedParticipants, numOfParticipants, status) "
            + "VALUES (?,?,?,?,?,?,?,?,?)";
    try {
      ps = connection.prepareStatement(query);
      ps.setString(1, study.getName());

      ps.setString(2, study.getDescription());
      ps.setString(3, study.getCreatorEmail());
      ps.setTimestamp(4, study.getDateCreated());
      ps.setString(5, study.getQuestion());
      ps.setString(6, study.getImageURL());
      ps.setInt(7, study.getRequestedParticipants());
      ps.setInt(8, study.getNumOfParticipants());
      ps.setString(9, study.getStatus());

      return ps.executeUpdate();
    } catch (SQLException e) {
      System.out.println(e);
      return 0;
    } finally {
      DBUtil.closePreparedStatement(ps);
      pool.freeConnection(connection);
    }
  }