01: package com.teamkonzept.field.db;
02:
03: import java.sql.*;
04:
05: import com.teamkonzept.db.*;
06: import com.teamkonzept.lib.*;
07: import com.teamkonzept.web.*;
08: import com.teamkonzept.field.*;
09: import com.teamkonzept.field.db.queries.*;
10: import org.apache.log4j.Category;
11:
12: public class TKReadFormFromDB {
13: private static Category cat = Category
14: .getInstance(TKReadFormFromDB.class);
15:
16: public TKVector formVector;
17:
18: public TKReadFormFromDB() {
19: };
20:
21: public void getForms() {
22:
23: try {
24: TKQuery q = TKDBManager.newQuery(TKDBGetAllFormIds.class);
25: q.execute();
26: ResultSet rs = q.fetchResultSet();
27:
28: formVector = new TKVector();
29:
30: int x = 0;
31: while (rs.next()) {
32: x++;
33: formVector.addElement(new TKOptionFieldEntry(rs
34: .getString("FIELD_SHOW_NAME"), rs
35: .getString("FORM_ID")));
36:
37: }
38: } catch (SQLException e) {
39: cat.error("GetallForms: " + e.getMessage(), e);
40: }
41:
42: }
43: }
|