Code example for ResultSet

Methods: close, getInt, next

0
 
		int newSeq = 0;
 
		PreparedStatement pstmt = conn.prepareStatement(query);
		ResultSet rs = pstmt.executeQuery();
		if (rs.next()) {
			newSeq = rs.getInt(1);
		} 
		pstmt.close();
		rs.close();
 
		return newSeq + 1;
	} 
	/** 
	 * fetch count number 
	 * @param conn 
	 * @param query 
	 * @return number 
	 * @throws SQLException 
	 */ 
	public int getCount(Connection conn, String query, Object[] params) throws SQLException {