Code example for ResultSet

Methods: close, getDouble, next

0
	 
	public Double getPriceSell(int id) throws SQLException {
 
		Statement s = con.createStatement();
		ResultSet rs = s.executeQuery("SELECT * FROM `shop` WHERE `id`=" + id);
		rs.next();
		Double a = rs.getDouble(3);
		rs.close();
		s.close();
		return a;
		 
	} 
 
	public Double getPriceBuy(int id) throws SQLException {
 
		Statement s = con.createStatement();
 
		ResultSet rs = s.executeQuery("SELECT * FROM `shop` WHERE `id`=" + id);
		rs.next();
		double a = rs.getDouble(4);
		rs.close();