public boolean createLike(String username,int pid){
    PreparedStatement stmt = null;
    Connection conn = null;
    ResultSet rs = null;
    try {
      conn = DbConnection.getConnection();
      stmt = conn.prepareStatement(GET_UID_OWNER);
      stmt.setString(1, username);
      rs = stmt.executeQuery();
      

      if (!rs.next()) {
        return false;
      }
      
      int uid = rs.getInt(1);
      try { stmt.close(); }
      catch (Exception e) { }
      

      stmt = conn.prepareStatement(NEW_LIKE_STMT);
      stmt.setInt(1, pid);
      stmt.setInt(2, uid);
      stmt.executeUpdate();
	return true;
    } catch (SQLException e) {
      e.printStackTrace();
      throw new RuntimeException(e);
    } finally {
      if (rs != null) {
        try { rs.close(); }
        catch (SQLException e) { ; }
        rs = null;
      }
      
      if (stmt != null) {
        try { stmt.close(); }
        catch (SQLException e) { ; 
        stmt = null;
      }
      
      if (conn != null) {
        try { conn.close(); }
        catch (SQLException e) { ; }
        conn = null;
      }
    }
  }
 }