KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > smile > stored > s_updateArticleDisableSection


1 package smile.stored;
2
3 import java.util.*;
4 import java.sql.*;
5
6 /**
7  * s_updateArticleDisableSection is an implements the ProcedureInterface and is
8  * a sub-class of StoredProcedure. Copyright 2002 Smile Les motoristes Internet
9  * http://www.smile.fr/ Contact cofax@smile.fr for further information
10  *
11  * @author Smile Les motoristes Internet
12  * @created March 22, 2002
13  */

14 public class s_updateArticleDisableSection extends StoredProcedure implements ProcedureInterface {
15
16     String JavaDoc in_itemID;
17
18     String JavaDoc in_disableIndex;
19
20     String JavaDoc in_disableArticle;
21
22     String JavaDoc in_verNum;
23
24     /**
25      * Constructor for the s_updateArticleDisableSection object
26      */

27     public s_updateArticleDisableSection() {
28     }
29
30     /**
31      * Description of the Method
32      *
33      * @param initData
34      * Description of the Parameter
35      * @param con
36      * Description of the Parameter
37      */

38     public void init(HashMap initData, Connection con) {
39         // on initialise le hashmap de donnees et la connection de l'objet
40
super.init(initData, con);
41         // on initialise les propprietes de l'objet
42
in_itemID = utils.getString(data, "ITEMID", "");
43         in_disableIndex = utils.getString(data, "DISABLEINDEX", "");
44         in_disableArticle = utils.getString(data, "DISABLEARTICLE", "");
45     }
46
47     /**
48      * Description of the Method
49      *
50      * @exception SQLException
51      * Description of the Exception
52      */

53     public void checkParams() throws SQLException {
54     }
55
56     /**
57      * Description of the Method
58      *
59      * @exception SQLException
60      * Description of the Exception
61      */

62     public void checkAction() throws SQLException {
63         if (in_itemID.equals(""))
64             throw new SQLException("s_updateArticleDisableSection: ERROR: required field ITEMID was not sent.");
65         if (in_disableIndex.equals(""))
66             throw new SQLException("s_updateArticleDisableSection: ERROR: required field DISABLEINDEX was not sent.");
67         if (in_disableArticle.equals(""))
68             throw new SQLException("s_updateArticleDisableSection: ERROR: required field DISABLEARTICLE was not sent.");
69     }
70
71     /**
72      * Description of the Method
73      *
74      * @exception SQLException
75      * Description of the Exception
76      */

77     public void executeAction() throws SQLException {
78
79         StringBuffer JavaDoc v_sb = new StringBuffer JavaDoc();
80         v_sb.append("UPDATE tblarticles ").append(" SET disableArticle = '" + in_disableArticle + "', ").append(" disableIndex = '" + in_disableIndex + "' ")
81                 .append(" WHERE itemID = '" + in_itemID + "' ");
82
83         execStatement(v_sb.toString());
84
85         execStatementToRS(queryResultOk);
86     }
87
88 }
89
Popular Tags