Code example for PreparedStatement

Methods: executeQuery, setBytes

0
		 
		byte[] md5 = md5(uri);	 
		 
		try { 
			PreparedStatement ps = conn.prepareStatement("SELECT * FROM QUERY_CACHE WHERE QUERYHASH=? LIMIT 1");
			ps.setBytes(1, md5);
			java.sql.ResultSet rs = ps.executeQuery();
			 
			Clob clob = rs.getClob("TRIPLES");
			 
			model.read(clob.getAsciiStream(), null, "N-TRIPLE");
		} catch (SQLException e) {
			e.printStackTrace();
		} 
		 
		return model;
	} 
 
	@Override 
	public Model getModel(String uri, int recursionDepth) {
		// TODO Auto-generated method stub