/** * Request a tag id by providing the comment id. On success it returns the tag id, * on failure this function will return 0 * * @param cid comment id * @return tag id on success, 0 on failure */ public int getTagIdByCommentId(int cid) { String sql = "SELECT taggedid FROM " + getTagTable() + " WHERE commentid = '" + cid + "' AND sectionid = '" + getSectionId() + "'"; try { ResultSet rs2 = select(sql); if(! rs2.next()) { System.out.println("dddd"); return 0;} int tid = rs2.getInt("taggedid"); rs2.close(); return tid; } catch (SQLException e) { e.printStackTrace(); return 0; } }