Code example for ResultSet

Methods: close, getDouble, next

0
	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();
		s.close();
		return a;
	} 
 
}