KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > teamkonzept > field > db > TKFormDBInterface


1 /*
2  * $Header: /cvsroot/webman-cms/source/webman/com/teamkonzept/field/db/TKFormDBInterface.java,v 1.7 2000/06/19 14:06:46 alex Exp $
3  *
4  */

5 package com.teamkonzept.field.db;
6
7 import java.sql.*;
8
9 import com.teamkonzept.db.*;
10 import com.teamkonzept.field.db.queries.*;
11
12 public class TKFormDBInterface extends TKDBVectorInterface {
13
14     public final static String JavaDoc[] tables = { "FIELD", "SUB_FIELD", "FIELD_ATTRIBUTE" };
15
16     public final static Class JavaDoc deleteQuery = TKDBFormTablesDelete.class;
17     public final static Class JavaDoc[] putQueries =
18         { TKDBFormFieldPut.class, TKDBFormSubFieldPut.class, TKDBFormFieldAttrPut.class };
19
20     public final static Class JavaDoc[] getQueries =
21         { TKDBFormFieldGet.class, TKDBFormSubFieldGet.class, TKDBFormFieldAttrGet.class };
22
23     public final static Class JavaDoc newPrimQuery = TKDBFormNew.class;
24     public final static Class JavaDoc updatePrimQuery = TKDBFormUpdate.class;
25     public final static Class JavaDoc getPrimQuery = TKDBFormGet.class;
26     public final static Class JavaDoc delPrimQuery = TKDBFormDelete.class;
27
28     public static TKFormDBInterface self = new TKFormDBInterface();
29
30     public TKFormDBInterface() {
31         super(
32             newPrimQuery, updatePrimQuery, getPrimQuery, delPrimQuery,
33             tables, putQueries, getQueries, deleteQuery);
34     }
35
36     public static void Put(TKFormDBData dbData)
37         throws SQLException
38     {
39         self.putEntry(dbData);
40     }
41
42     public static void Get(TKFormDBData dbData)
43         throws SQLException
44     {
45         self.getEntry(dbData);
46     }
47
48     public static void Del(TKFormDBData dbData)
49         throws SQLException
50     {
51         self.delEntry(dbData);
52     }
53
54     public static void New(TKFormDBData dbData)
55         throws SQLException
56     {
57         self.newEntry(dbData);
58     }
59
60     public void insertVectorElements(TKDBTableData d, TKQuery query, String JavaDoc table, int i)
61         throws SQLException
62     {
63         query.setQueryParams("POS", new Integer JavaDoc(i));
64         d.insertIntoQuery( query );
65     }
66
67 }
68
69
Popular Tags