package acspg; import java.sql.*; import java.io.*; import javax.mail.*; import javax.mail.internet.*; import java.util.*; import javax.activation.*; import nsjava.*; public class HeadersIter { String query; NsSet rs; NsLog log; Pg_Query st; Integer col_name; Integer col_value; String name; String value; public HeadersIter(Pg_Query st, String query) throws SQLException { this.log = new NsLog(); this.rs = st.select(query); if(this.rs != null) { this.col_name = this.rs.find("name"); this.col_value = this.rs.find("value"); } log.write("Debug", "name = " + this.col_name); log.write("Debug", "value = " + this.col_value); } public boolean next(Pg_Query st) throws SQLException { if(this.rs != null) { if(st.getrow(this.rs) == true) { this.name = this.rs.value(this.col_name); this.value = this.rs.value(this.col_value); return true; } } return false; } public String name() { return this.name; } public String value() { return this.value; } public void close() throws SQLException { this.rs.free(); } }