| CustomerUpdate.java |
1 package com.orindasoft.demo.generated.sql;
2
3 import java.sql.*;
4
5 import com.orindasoft.pub.LogInterface;
6 import com.orindasoft.pub.OracleResourceUser;
7 import com.orindasoft.pub.CSException;
8
9 /**
10 * CustomerUpdate.sql
11 *
12 * <p>Generated by JDBCWizard./a> build 2776 at 2011/03/07 19:55:47.893 GMT
13 * <p>JDBCWizard./a> is made by Orinda Software Ltd, Dublin, Ireland
14 * <p>Target Database: Oracle 10.2.0
15 * <p> -------------------------------------------------------------------------
16 * <p> WARNING: This code will stop working around the time JDBCWizard./a> expires.
17 * <p> This restriction only exists in the demo version of JDBCWizard./a>.
18 * <p> -------------------------------------------------------------------------
19 * <p> JDBCWizard./a> Tips 6 of 19:
20 * <p> JDBCWizard./a> can run stored procedures with PL/SQL package records as parameters
21 * <p> -------------------------------------------------------------------------
22 *
23 * <p>Copyright Orinda Software 2003-2009
24 * <p>File Name CustomerUpdate.sql
25 * <p>This class runs the SQL statement below:
26 * <code><pre>
27 * -------------------------------------------------------------
28 * UPDATE CUSTOMERS
29 * /* parameters can be specified using either the '_' JDBC syntax or the ampersand syntax
30 * that is used in SQL*Plus. Note that '' characters on either side of a parameter will
31 * be removed, as will any trailing semi-colons or slashes at the end of the statement
32 * SET address = NVL(? /* address ,address) /* string
33 * , city = NVL(? /* city ,city) /* string
34 * , state = NVL(? /* state ,state) /* string
35 * , zip = NVL(? /* zip ,zip) /* number
36 * , birthdate = NVL(? /* bdate , birthdate) /* date
37 * , phone = NVL(? /* phone ,phone) /* string
38 * where name = ? /* name /* String
39 * -------------------------------------------------------------
40 * </pre></code>
41 * @author devteam60@orindabuild.com
42 * @version 1.1
43 */
44 public class CustomerUpdate extends AbstractSqlStatement implements OracleResourceUser
45 {
46
47 /**
48 * Variable to store Paramaddress
49 */
50 public String Paramaddress = null;
51
52 /**
53 * Variable to store Paramcity
54 */
55 public String Paramcity = null;
56
57 /**
58 * Variable to store Paramstate
59 */
60 public String Paramstate = null;
61
62 /**
63 * Variable to store Paramzip
64 */
65 public java.math.BigDecimal Paramzip = null;
66
67 /**
68 * Variable to store Parambdate
69 * @since 4.0.2016 DATE columns are now represented with java.util.Date instead of java.sql.Timestamp
70 */
71 public java.util.Date Parambdate = null;
72
73 /**
74 * Variable to store Paramphone
75 */
76 public String Paramphone = null;
77
78 /**
79 * Variable to store Paramname
80 */
81 public String Paramname = null;
82
83 /**
84 * Sql statement text
85 */
86 private static final String SQLTEXT = "UPDATE CUSTOMERS \n" // 1
87 +"/* parameters can be specified using either the '_' JDBC syntax or the ampersand syntax \n" // 2
88 +" that is used in SQL*Plus. Note that '' characters on either side of a parameter will \n" // 3
89 +" be removed, as will any trailing semi-colons or slashes at the end of the statement */ \n" // 4
90 +"SET address = NVL(? /* address */,address) /* string */ \n" // 5
91 +" , city = NVL(? /* city */,city) /* string */ \n" // 6
92 +" , state = NVL(? /* state */,state) /* string */ \n" // 7
93 +" , zip = NVL(? /* zip */,zip) /* number */ \n" // 8
94 +" , birthdate = NVL(? /* bdate */, birthdate) /* date */ \n" // 9
95 +" , phone = NVL(? /* phone */,phone) /* string */ \n" // 10
96 +"where name = ? /* name */ /* String */ "; // 11 628 characters
97
98 /**
99 * Constructor that calls the Constructor of AbstractSqlStatement
100 * @param Connection theConnection a database connection
101 * @param LogInterface theLog a logging object
102 *
103 */
104 public CustomerUpdate (Connection theConnection, LogInterface theLog)
105 {
106 super(theConnection, theLog);
107 theLog.debug("CustomerUpdate started"); //DEBUG
108 }
109
110
111 /**
112 * Method to set parameter Paramaddress
113 * @param String Paramaddress
114 */
115 public void setParamaddress(String Paramaddress)
116 {
117 this.Paramaddress = Paramaddress;
118 }
119
120 /**
121 * Method to set parameter Paramaddress to null
122 */
123 public void setParamaddressToNull()
124 {
125 this.Paramaddress = null;
126 }
127
128 /**
129 * Method to set parameter Paramcity
130 * @param String Paramcity
131 */
132 public void setParamcity(String Paramcity)
133 {
134 this.Paramcity = Paramcity;
135 }
136
137 /**
138 * Method to set parameter Paramcity to null
139 */
140 public void setParamcityToNull()
141 {
142 this.Paramcity = null;
143 }
144
145 /**
146 * Method to set parameter Paramstate
147 * @param String Paramstate
148 */
149 public void setParamstate(String Paramstate)
150 {
151 this.Paramstate = Paramstate;
152 }
153
154 /**
155 * Method to set parameter Paramstate to null
156 */
157 public void setParamstateToNull()
158 {
159 this.Paramstate = null;
160 }
161
162 /**
163 * Method to set parameter Paramzip
164 * @param double Paramzip
165 */
166 public void setParamzip(double Paramzip)
167 {
168 this.Paramzip = new java.math.BigDecimal(Paramzip);
169 }
170
171 /**
172 * Method to set parameter Paramzip
173 * @param long Paramzip
174 */
175 public void setParamzip(long Paramzip)
176 {
177 this.Paramzip = new java.math.BigDecimal((double)Paramzip);
178 }
179
180 /**
181 * Method to set parameter Paramzip
182 * @param int Paramzip
183 */
184 public void setParamzip(int Paramzip)
185 {
186 this.Paramzip = new java.math.BigDecimal((double)Paramzip);
187 }
188
189 /**
190 * Method to set parameter Paramzip
191 * @param java.math.BigDecimal Paramzip
192 */
193 public void setParamzip(java.math.BigDecimal Paramzip)
194 {
195 if (Paramzip == null)
196 {
197 this.Paramzip = null;
198 }
199 else
200 {
201 this.Paramzip = new java.math.BigDecimal(Paramzip.doubleValue());
202 }
203 }
204
205 /**
206 * Method to set parameter Paramzip to null
207 */
208 public void setParamzipToNull()
209 {
210 this.Paramzip = null;
211 }
212
213 /**
214 * Method to set parameter Parambdate
215 * @param java.util.Date Parambdate
216 */
217 public void setParambdate(java.util.Date Parambdate)
218 {
219 if (Parambdate == null)
220 {
221 this.Parambdate = null;
222 }
223 else
224 {
225 this.Parambdate = new java.util.Date(Parambdate.getTime());
226 }
227 }
228
229 /**
230 * Method to set parameter Parambdate
231 * @param long Parambdate
232 */
233 public void setParambdate(long Parambdate)
234 {
235 this.Parambdate = new java.util.Date(Parambdate);
236 }
237
238 /**
239 * Method to set parameter Parambdate
240 * @param java.sql.Timestamp Parambdate
241 */
242 public void setParambdate(java.sql.Timestamp Parambdate)
243 {
244 if (Parambdate == null)
245 {
246 this.Parambdate = null;
247 }
248 else
249 {
250 this.Parambdate = new java.util.Date(Parambdate.getTime());
251 }
252 }
253
254 /**
255 * Method to set parameter Parambdate to null
256 */
257 public void setParambdateToNull()
258 {
259 this.Parambdate = null;
260 }
261
262 /**
263 * Method to set parameter Paramphone
264 * @param String Paramphone
265 */
266 public void setParamphone(String Paramphone)
267 {
268 this.Paramphone = Paramphone;
269 }
270
271 /**
272 * Method to set parameter Paramphone to null
273 */
274 public void setParamphoneToNull()
275 {
276 this.Paramphone = null;
277 }
278
279 /**
280 * Method to set parameter Paramname
281 * @param String Paramname
282 */
283 public void setParamname(String Paramname)
284 {
285 this.Paramname = Paramname;
286 }
287
288 /**
289 * Method to set parameter Paramname to null
290 */
291 public void setParamnameToNull()
292 {
293 this.Paramname = null;
294 }
295
296
297
298 /**
299 * Associate parameters with statement
300 */
301 protected void bindParams() throws CSException
302 {
303 theLog.debug("CustomerUpdate - Binding Parameters"); //DEBUG
304 theLog.debug("Starting to bind parameters");
305 // Bind parameter Paramaddress
306
307 theLog.debug("binding input parameter Paramaddress to position 1");
308 theParameters.setParam(1,Paramaddress);
309 // Bind parameter Paramcity
310
311 theLog.debug("binding input parameter Paramcity to position 2");
312 theParameters.setParam(2,Paramcity);
313 // Bind parameter Paramstate
314
315 theLog.debug("binding input parameter Paramstate to position 3");
316 theParameters.setParam(3,Paramstate);
317 // Bind parameter Paramzip
318
319 theLog.debug("binding input parameter Paramzip to position 4");
320 theParameters.setParam(4,Paramzip);
321 // Bind parameter Parambdate
322
323 theLog.debug("binding input parameter Parambdate to position 5");
324 if (Parambdate != null)
325 {
326 theParameters.setParam(5,Parambdate);
327 }
328 else
329 {
330 theParameters.setParam(5,(java.util.Date)null);
331 }
332 // Bind parameter Paramphone
333
334 theLog.debug("binding input parameter Paramphone to position 6");
335 theParameters.setParam(6,Paramphone);
336 // Bind parameter Paramname
337
338 theLog.debug("binding input parameter Paramname to position 7");
339 theParameters.setParam(7,Paramname);
340 theLog.debug("Associating parameters with statement");
341 theParameters.bindParameters(theStatement);
342 theLog.debug("Finished binding parameters");
343 }
344
345
346 /**
347 * Return the SQL statement.
348 *
349 *
350 */
351 public String getProcCallStatement()
352 {
353 return (SQLTEXT);
354 }
355
356} // Generated by JDBCWizard./a> 6.0.2776
357