KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > content > db > queries > UpdateContent


1 package de.webman.content.db.queries;
2
3 import java.sql.Connection JavaDoc;
4 import java.sql.Types JavaDoc;
5 import com.teamkonzept.db.TKPrepQuery;
6 import de.webman.content.db.ContentConstants;
7
8 /**
9  * Updates an existing content in the database.
10  * <TABLE>
11  * <TR>
12  * <TD><B>Order</B></TD>
13  * <TD><B>Name</B></TD>
14  * <TD><B>Type</B></TD>
15  * </TR>
16  * <TR>
17  * <TD COLSPAN="3"><I>Parameters<I/></TD>
18  * </TR>
19  * <TR>
20  * <TD><TT>1</TT></TD>
21  * <TD><TT>de.webman.content.db.ContentConstants.XML_TEXT</TT></TD>
22  * <TD><TT>java.lang.String</TT></TD>
23  * </TR>
24  * <TR>
25  * <TD><TT>2</TT></TD>
26  * <TD><TT>de.webman.content.db.ContentConstants.CONTENT_ID</TT></TD>
27  * <TD><TT>java.lang.Integer</TT></TD>
28  * </TR>
29  * </TABLE>
30  *
31  * @author <A HREF="mailto:unl@webman.de">Ulrich Nicolas Liss&eacute;</A>,
32  * &copy; 2001 Webman AG.
33  * @version $Revision: 1.1 $
34  */

35 public class UpdateContent
36     extends TKPrepQuery
37 {
38     // $Id: UpdateContent.java,v 1.1 2001/09/28 14:50:36 uli Exp $
39

40     // Constants.
41

42     /**
43      * The preparation state.
44      */

45     private final static boolean IS_PREPARED = true;
46
47     /**
48      * The parameter order.
49      */

50     private final static String JavaDoc[] PARAMETER_ORDER =
51     {
52         ContentConstants.XML_TEXT,
53         ContentConstants.CONTENT_ID
54     };
55
56     /**
57      * The parameter types.
58      */

59     private final static Object JavaDoc[][] PARAMETER_TYPES =
60     {
61         {ContentConstants.XML_TEXT, new Integer JavaDoc(Types.VARCHAR)},
62         {ContentConstants.CONTENT_ID, new Integer JavaDoc(Types.INTEGER)}
63     };
64
65     /**
66      * The relevance state.
67      */

68     private final static boolean[] SET_RELEVANTS =
69     {
70         false
71     };
72
73     /**
74      * The SQL statement.
75      */

76     private final static String JavaDoc SQL_STRING = (new StringBuffer JavaDoc()).append("UPDATE CONTENT SET XML_TEXT = ? WHERE CONTENT_ID = ?").toString();
77
78
79     // Implementation of 'com.teamkonzept.db.TKQuery'
80

81     /**
82      * Initializes the query with the given connection.
83      *
84      * @param connection the connection.
85      */

86     public void initQuery (Connection JavaDoc connection)
87     {
88         super.initQuery(connection,
89                         IS_PREPARED,
90                         PARAMETER_ORDER,
91                         PARAMETER_TYPES,
92                         SET_RELEVANTS,
93                         SQL_STRING);
94     }
95
96 }
97
Popular Tags