--- FM2SQL/Attic/DBBean.java 2003/12/18 10:47:49 1.2 +++ FM2SQL/Attic/DBBean.java 2004/01/22 12:28:03 1.5 @@ -1,5 +1,5 @@ -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; + + import java.sql.*; import java.util.*; import com.fmi.jdbc.*; @@ -53,6 +53,7 @@ public class DBBean String url = ""; DatabaseMetaData dbMetaData; Vector columnNames; + Vector ids = new Vector(); String user = (System.getProperty("user.name") == null) ? "" : System.getProperty("user.name"); //"postgres"; String passwd = ""; //"3333";//"rogo"; public int maxHits = 10; @@ -194,6 +195,18 @@ public class DBBean quoteChar = "\""; // needed for postgres } + public void setIDVector(Vector ids) + { + this.ids = ids; + } + + /** + * returns a Vector containing the ID Row Name + **/ + public Vector getIDVector() + { + return ids; + } /** * returns a Vector containing the Tablenames or an error message in the Vector */ @@ -1343,5 +1356,21 @@ public class DBBean resultSet.next(); return resultSet.getInt(1); } - -} + public TreeSet getIDVector(String id,String table) throws Exception + { + TreeSet t= new TreeSet(); + getConnection(); + ResultSet result = this.result; + makeQuery("select "+id+" from "+getQC()+table+getQC(),0 ); + while(true) + { + + Vector vec = getNextRow(); + if(vec==null) break; + t.add(vec.get(0)); + } + this.result=result; + return t; + } + +} \ No newline at end of file