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