Code example for ResultSet

Methods: closegetIntnext

0
		try { 
			Connection c=(Connection)intGetObject();
			Statement st=c.createStatement();
			st.setQueryTimeout(5);
			ResultSet rs=st.executeQuery("select 7");
			rs.next();
			int r=rs.getInt(1);
			// Set the value to true only if r==7 
			ret=(r==7);
			rs.close();
			st.close();
		} catch(Exception e) {
			// Turn off availability 
			setUnavailable(); 
		} 
		return(ret);
	} 
 
	/** 
	 * Overridden to deal with SQL Warnings. 
Stop searching for code, let great code find you!  Add Codota to your java IDE