1  package com.orindasoft.demo.generated;
2  
3  
4  import com.orindasoft.pub.CSException; 
5  import com.orindasoft.pub.CSDBException; 
6  import com.orindasoft.pub.SqlUtils; 
7  import com.orindasoft.pub.OracleResourceUser; 
8  import com.orindasoft.pub.LogInterface; 
9  import com.orindasoft.demo.generated.plsql.*; 
10 // JSR-181 Support is enabled if your target JVM is 1.6 or higher...
11 import javax.jws.*; 
12 // If you need to change the behaviour of @WebService use the 'Extra Java' field of 
13 // 'Extra Options' tab - any @WebService specified there will replace the one below
14 @WebService(endpointInterface = "com.orindasoft.demo.generated.DAOFactoryServiceInterface")
15 /** 
16 * WSDL Compatible Web Services class used by classes generated by OrindaBuild
17 * 
18 * <p>Generated by OrindaBuild build 2699 at 2010/02/27 12:21:51 GMT
19 * <p>OrindaBuild is made by Orinda Software Ltd, Dublin, Ireland
20 * <p>Target Database: Oracle 10.2.0
21 * <p> -------------------------------------------------------------------------
22 * <p> WARNING: This code will stop working around the time OrindaBuild expires.
23 * <p> This restriction only exists in the demo version of OrindaBuild.
24 * <p> -------------------------------------------------------------------------
25 * <p> OrindaBuild Tips 18 of 19:
26 * <p> OrindaBuild also runs as a Plugin for Eclipse 3.0
27 * <p> -------------------------------------------------------------------------
28 * 
29 * <p>Copyright Orinda Software 2003-2009
30 * @author devteam60@orindabuild.com
31 * @version 1.1
32 */ 
33 public class DAOFactoryServiceImpl extends DAOFactory implements OracleResourceUser, DAOFactoryServiceInterface
34 { 
35  
36 /** 
37 * Flag the says whether we should release DB resources after 
38 * each service call. The default value for this is controlled by 
39 * the OrindaBuild UI.
40 * @since OrindaBuild 4.0.2139
41 */ 
42 protected boolean alwaysReleaseResources = false; 
43 
44 /** 
45 * Call parent constructor with no arguments
46 * @see com.orindasoft.demo.generated.DAOFactory
47 */                                   
48 public DAOFactoryServiceImpl() 
49   {                                                 
50   super();
51   }                                                 
52                                                  
53 /** 
54 * Call constructor of DAOFactory using a database connection and an instance of LogInterface 
55 * @param java.sql.Connection theConnection A database connection 
56 * @param LogInterface theLog An instance of a class that implements com.orindasoft.pub.LogInterface 
57 * @see com.orindasoft.demo.generated.DAOFactory
58 * @since OrindaBuild V5.0.2239
59 */ 
60 public DAOFactoryServiceImpl(java.sql.Connection theConnection, LogInterface theLog) 
61   { 
62   super(theConnection,theLog); 
63   } 
64  
65 /** 
66 * Call constructor of DAOFactory using an instance of LogInterface  
67 * @param LogInterface theLog An instance of a class that implements com.orindasoft.pub.LogInterface  
68 * @see com.orindasoft.demo.generated.DAOFactory
69 * @since OrindaBuild V5.0.2239
70 */                                   
71 public DAOFactoryServiceImpl(LogInterface theLog)      
72   {                                                 
73   super(theLog);
74   }                                                  
75    
76  
77 /** 
78 * Set flag the says whether we should release DB resources after 
79 * each service call.
80 * @since OrindaBuild 4.0.2139
81 */ 
82 protected void setAlwaysReleaseResourcesFlag(boolean alwaysReleaseResources)
83   {
84   this.alwaysReleaseResources = alwaysReleaseResources;
85   }
86  
87 /** 
88 * SequentialNumberGenerator - Access Sequence SEQUENTIAL_NUMBER_GENERATOR
89 */ 
90 public long serviceSequenceSequentialNumberGenerator() throws DAOFactoryServiceException
91   {
92   try
93     {
94     com.orindasoft.demo.generated.sequence.SequentialNumberGenerator theService = getSequentialNumberGeneratorSequenceDAO();
95     
96     return (theService.getNext());
97     }
98   catch (com.orindasoft.pub.CSException e)
99     {
100    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
101    theLog.error(e.getMessage());
102    throw (e2);
103    }
104  }
105/** 
106* Call Class CursorExampleDirectFlightAvailable as a service
107* @param String paramPFromcity VARCHAR2
108* @param String paramPTocity VARCHAR2
109* @return boolean
110* @throws DAOFactoryServiceException
111*/
112// JSR-181 support - make this method part of a web service
113@WebMethod
114public boolean servicePlsqlCursorExampleDirectFlightAvailable
115    (@WebParam(name="paramPFromcity") String paramPFromcity
116    ,@WebParam(name="paramPTocity") String paramPTocity) throws DAOFactoryServiceException
117  {
118  try
119    {
120    theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable Starting");
121    
122    // Declare variable to hold result of service
123    boolean serviceOutput;
124    
125    // Get instance of created class
126    theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable: Get instance of created class");
127    com.orindasoft.demo.generated.plsql.CursorExampleDirectFlightAvailable theService = getCursorExampleDirectFlightAvailablePlSqlDAO();
128    
129    // Set parameters
130    theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable: Set parameters");
131    theService.setParamPFromcity(paramPFromcity);
132    theService.setParamPTocity(paramPTocity);
133    
134    // Call procedure
135    theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable: Call procedure");
136    theService.executeProc();
137    
138    // Unload results
139    theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable: Unload results");
140    serviceOutput = theService.getFunctionResultBoolean();
141    
142    if (alwaysReleaseResources)
143      {
144      // Hand back DB connection...
145      releaseResources();
146      }
147    
148    
149    theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable Returning Data");
150    return(serviceOutput);
151    }
152  catch (com.orindasoft.pub.CSException e)
153    {
154    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
155    theLog.error("servicePlsqlCursorExampleDirectFlightAvailable Failed:");
156    theLog.error(e.getMessage());
157    throw (e2);
158    }
159  }
160/** 
161* Call Class CursorExampleFindDirectFlights as a service
162* @param String paramPFromcity VARCHAR2
163* @param String paramPTocity VARCHAR2
164* @param double paramPOrderby NUMBER
165* @return com.orindasoft.demo.generated.plsql.CursorExampleFlightsRefcursorTypeAttrs[]
166* @throws DAOFactoryServiceException
167*/
168// JSR-181 support - make this method part of a web service
169@WebMethod
170public com.orindasoft.demo.generated.plsql.CursorExampleFlightsRefcursorTypeAttrs[] servicePlsqlCursorExampleFindDirectFlights
171    (@WebParam(name="paramPFromcity") String paramPFromcity
172    ,@WebParam(name="paramPTocity") String paramPTocity
173    ,@WebParam(name="paramPOrderby") double paramPOrderby) throws DAOFactoryServiceException
174  {
175  try
176    {
177    theLog.debug("servicePlsqlCursorExampleFindDirectFlights Starting");
178    
179    // Declare variable to hold result of service
180    com.orindasoft.demo.generated.plsql.CursorExampleFlightsRefcursorTypeAttrs[] serviceOutput;
181    
182    // Get instance of created class
183    theLog.debug("servicePlsqlCursorExampleFindDirectFlights: Get instance of created class");
184    com.orindasoft.demo.generated.plsql.CursorExampleFindDirectFlights theService = getCursorExampleFindDirectFlightsPlSqlDAO();
185    
186    // Make sure we avoid temporary files
187    theService.setUseByteArraysForLongsAndLOBS(true);
188    
189    // Set parameters
190    theLog.debug("servicePlsqlCursorExampleFindDirectFlights: Set parameters");
191    theService.setParamPFromcity(paramPFromcity);
192    theService.setParamPTocity(paramPTocity);
193    theService.setParamPOrderby(paramPOrderby);
194    
195    // Call procedure
196    theLog.debug("servicePlsqlCursorExampleFindDirectFlights: Call procedure");
197    theService.executeProc();
198    
199    // Unload results
200    theLog.debug("servicePlsqlCursorExampleFindDirectFlights: Unload results");
201    serviceOutput = (CursorExampleFlightsRefcursorTypeAttrs[])CursorExampleFlightsRefcursorType.createCursorExampleFlightsRefcursorTypeArrayFromRowSet(theService.getParamPFlightlist(),theLog);
202    
203    if (alwaysReleaseResources)
204      {
205      // Hand back DB connection...
206      releaseResources();
207      }
208    
209    
210    theLog.debug("servicePlsqlCursorExampleFindDirectFlights Returning Data");
211    return(serviceOutput);
212    }
213  catch (com.orindasoft.pub.CSException e)
214    {
215    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
216    theLog.error("servicePlsqlCursorExampleFindDirectFlights Failed:");
217    theLog.error(e.getMessage());
218    throw (e2);
219    }
220  }
221/** 
222* Call Class CursorExampleGetlists as a service
223* @return com.orindasoft.demo.generated.plsql.CursorExampleGetlistsReturn
224* @throws DAOFactoryServiceException
225*/
226// JSR-181 support - make this method part of a web service
227@WebMethod
228public com.orindasoft.demo.generated.plsql.CursorExampleGetlistsReturn servicePlsqlCursorExampleGetlists() throws DAOFactoryServiceException
229  {
230  try
231    {
232    theLog.debug("servicePlsqlCursorExampleGetlists Starting");
233    
234    // Declare variable to hold result of service
235    com.orindasoft.demo.generated.plsql.CursorExampleGetlistsReturn serviceOutput = new com.orindasoft.demo.generated.plsql.CursorExampleGetlistsReturn();
236    
237    // Get instance of created class
238    theLog.debug("servicePlsqlCursorExampleGetlists: Get instance of created class");
239    com.orindasoft.demo.generated.plsql.CursorExampleGetlists theService = getCursorExampleGetlistsPlSqlDAO();
240    
241    // Make sure we avoid temporary files
242    theService.setUseByteArraysForLongsAndLOBS(true);
243    
244    // Set parameters
245    theLog.debug("servicePlsqlCursorExampleGetlists: Set parameters");
246    
247    // Call procedure
248    theLog.debug("servicePlsqlCursorExampleGetlists: Call procedure");
249    theService.executeProc();
250    
251    // Unload results
252    theLog.debug("servicePlsqlCursorExampleGetlists: Unload results");
253    serviceOutput.setParamPAirlineListing((CursorExampleAirlineRefcursorTypeAttrs[])CursorExampleAirlineRefcursorType.createCursorExampleAirlineRefcursorTypeArrayFromRowSet(theService.getParamPAirlineListing(),theLog));
254    serviceOutput.setParamPAirportListing((CursorExampleAirportRefcursorTypeAttrs[])CursorExampleAirportRefcursorType.createCursorExampleAirportRefcursorTypeArrayFromRowSet(theService.getParamPAirportListing(),theLog));
255    serviceOutput.setParamPAircraftListing((CursorExampleAircraftRefcursorTypeAttrs[])CursorExampleAircraftRefcursorType.createCursorExampleAircraftRefcursorTypeArrayFromRowSet(theService.getParamPAircraftListing(),theLog));
256    
257    if (alwaysReleaseResources)
258      {
259      // Hand back DB connection...
260      releaseResources();
261      }
262    
263    
264    theLog.debug("servicePlsqlCursorExampleGetlists Returning Data");
265    return(serviceOutput);
266    }
267  catch (com.orindasoft.pub.CSException e)
268    {
269    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
270    theLog.error("servicePlsqlCursorExampleGetlists Failed:");
271    theLog.error(e.getMessage());
272    throw (e2);
273    }
274  }
275/** 
276* Call Class ObjectArrayExampleAddBookingsObjectArray as a service
277* @param CustomersAttrs paramPCustomer PL/SQL RECORD
278* @param BookingsTypeAttrs[] paramPBookingTable TABLE
279* @return String
280* @throws DAOFactoryServiceException
281*/
282// JSR-181 support - make this method part of a web service
283@WebMethod
284public String servicePlsqlObjectArrayExampleAddBookingsObjectArray
285    (@WebParam(name="paramPCustomer") CustomersAttrs paramPCustomer
286    ,@WebParam(name="paramPBookingTable") BookingsTypeAttrs[] paramPBookingTable) throws DAOFactoryServiceException
287  {
288  try
289    {
290    theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray Starting");
291    
292    // Declare variable to hold result of service
293    String serviceOutput;
294    
295    // Get instance of created class
296    theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray: Get instance of created class");
297    com.orindasoft.demo.generated.plsql.ObjectArrayExampleAddBookingsObjectArray theService = getObjectArrayExampleAddBookingsObjectArrayPlSqlDAO();
298    
299    // Set parameters
300    theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray: Set parameters");
301    theService.setParamPCustomer(Customers.createCustomersFromCustomersAttrs(paramPCustomer));
302    theService.setParamPBookingTable(new BookingsTable(theLog, (BookingsType.createBookingsTypeArrayFromBookingsTypeAttrsArray(paramPBookingTable))));
303    
304    // Call procedure
305    theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray: Call procedure");
306    theService.executeProc();
307    
308    // Unload results
309    theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray: Unload results");
310    serviceOutput = theService.getParamPStatusMessage();
311    
312    if (alwaysReleaseResources)
313      {
314      // Hand back DB connection...
315      releaseResources();
316      }
317    
318    
319    theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray Returning Data");
320    return(serviceOutput);
321    }
322  catch (com.orindasoft.pub.CSException e)
323    {
324    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
325    theLog.error("servicePlsqlObjectArrayExampleAddBookingsObjectArray Failed:");
326    theLog.error(e.getMessage());
327    throw (e2);
328    }
329  }
330/** 
331* Call Class ObjectArrayExampleGetObjectArrayOfFlights as a service
332* @param String paramPCity VARCHAR2
333* @return FlightsTypeAttrs[]
334* @throws DAOFactoryServiceException
335*/
336// JSR-181 support - make this method part of a web service
337@WebMethod
338public FlightsTypeAttrs[] servicePlsqlObjectArrayExampleGetObjectArrayOfFlights
339    (@WebParam(name="paramPCity") String paramPCity) throws DAOFactoryServiceException
340  {
341  try
342    {
343    theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights Starting");
344    
345    // Declare variable to hold result of service
346    FlightsTypeAttrs[] serviceOutput;
347    
348    // Get instance of created class
349    theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights: Get instance of created class");
350    com.orindasoft.demo.generated.plsql.ObjectArrayExampleGetObjectArrayOfFlights theService = getObjectArrayExampleGetObjectArrayOfFlightsPlSqlDAO();
351    
352    // Set parameters
353    theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights: Set parameters");
354    theService.setParamPCity(paramPCity);
355    
356    // Call procedure
357    theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights: Call procedure");
358    theService.executeProc();
359    
360    // Unload results
361    theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights: Unload results");
362    serviceOutput = theService.getParamPFlightsFrom().getCurrentValues();
363    
364    if (alwaysReleaseResources)
365      {
366      // Hand back DB connection...
367      releaseResources();
368      }
369    
370    
371    theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights Returning Data");
372    return(serviceOutput);
373    }
374  catch (com.orindasoft.pub.CSException e)
375    {
376    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
377    theLog.error("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights Failed:");
378    theLog.error(e.getMessage());
379    throw (e2);
380    }
381  }
382/** 
383* Call Class PackageArrayExampleAddBookingsPlsqlArray as a service
384* @param CustomersAttrs paramPCustomer PL/SQL RECORD
385* @param BookingsAttrs[] paramPBookingTable VARRAY
386* @return String
387* @throws DAOFactoryServiceException
388*/
389// JSR-181 support - make this method part of a web service
390@WebMethod
391public String servicePlsqlPackageArrayExampleAddBookingsPlsqlArray
392    (@WebParam(name="paramPCustomer") CustomersAttrs paramPCustomer
393    ,@WebParam(name="paramPBookingTable") BookingsAttrs[] paramPBookingTable) throws DAOFactoryServiceException
394  {
395  try
396    {
397    theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray Starting");
398    
399    // Declare variable to hold result of service
400    String serviceOutput;
401    
402    // Get instance of created class
403    theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray: Get instance of created class");
404    com.orindasoft.demo.generated.plsql.PackageArrayExampleAddBookingsPlsqlArray theService = getPackageArrayExampleAddBookingsPlsqlArrayPlSqlDAO();
405    
406    // Set parameters
407    theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray: Set parameters");
408    theService.setParamPCustomer(Customers.createCustomersFromCustomersAttrs(paramPCustomer));
409    theService.setParamPBookingTable(new PackageArrayExampleBookingsPlsqlArray(theLog, (Bookings.createBookingsArrayFromBookingsAttrsArray(paramPBookingTable))));
410    
411    // Call procedure
412    theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray: Call procedure");
413    theService.executeProc();
414    
415    // Unload results
416    theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray: Unload results");
417    serviceOutput = theService.getParamPStatusMessage();
418    
419    if (alwaysReleaseResources)
420      {
421      // Hand back DB connection...
422      releaseResources();
423      }
424    
425    
426    theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray Returning Data");
427    return(serviceOutput);
428    }
429  catch (com.orindasoft.pub.CSException e)
430    {
431    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
432    theLog.error("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray Failed:");
433    theLog.error(e.getMessage());
434    throw (e2);
435    }
436  }
437/** 
438* Call Class PackageArrayExampleGetPlsqlArrayOfFlights as a service
439* @param String paramPCity VARCHAR2
440* @return FlightsAttrs[]
441* @throws DAOFactoryServiceException
442*/
443// JSR-181 support - make this method part of a web service
444@WebMethod
445public FlightsAttrs[] servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights
446    (@WebParam(name="paramPCity") String paramPCity) throws DAOFactoryServiceException
447  {
448  try
449    {
450    theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights Starting");
451    
452    // Declare variable to hold result of service
453    FlightsAttrs[] serviceOutput;
454    
455    // Get instance of created class
456    theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights: Get instance of created class");
457    com.orindasoft.demo.generated.plsql.PackageArrayExampleGetPlsqlArrayOfFlights theService = getPackageArrayExampleGetPlsqlArrayOfFlightsPlSqlDAO();
458    
459    // Set parameters
460    theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights: Set parameters");
461    theService.setParamPCity(paramPCity);
462    
463    // Call procedure
464    theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights: Call procedure");
465    theService.executeProc();
466    
467    // Unload results
468    theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights: Unload results");
469    serviceOutput = theService.getParamPFlightsFrom().getCurrentValues();
470    
471    if (alwaysReleaseResources)
472      {
473      // Hand back DB connection...
474      releaseResources();
475      }
476    
477    
478    theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights Returning Data");
479    return(serviceOutput);
480    }
481  catch (com.orindasoft.pub.CSException e)
482    {
483    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
484    theLog.error("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights Failed:");
485    theLog.error(e.getMessage());
486    throw (e2);
487    }
488  }
489/** 
490* Call Class PackageIdxarrayExampleAddBookingsPlsqlArray as a service
491* @param CustomersAttrs paramPCustomer PL/SQL RECORD
492* @param BookingsAttrs[] paramPBookingTable PL/SQL TABLE
493* @return String
494* @throws DAOFactoryServiceException
495*/
496// JSR-181 support - make this method part of a web service
497@WebMethod
498public String servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray
499    (@WebParam(name="paramPCustomer") CustomersAttrs paramPCustomer
500    ,@WebParam(name="paramPBookingTable") BookingsAttrs[] paramPBookingTable) throws DAOFactoryServiceException
501  {
502  try
503    {
504    theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray Starting");
505    
506    // Declare variable to hold result of service
507    String serviceOutput;
508    
509    // Get instance of created class
510    theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray: Get instance of created class");
511    com.orindasoft.demo.generated.plsql.PackageIdxarrayExampleAddBookingsPlsqlArray theService = getPackageIdxarrayExampleAddBookingsPlsqlArrayPlSqlDAO();
512    
513    // Set parameters
514    theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray: Set parameters");
515    theService.setParamPCustomer(Customers.createCustomersFromCustomersAttrs(paramPCustomer));
516    theService.setParamPBookingTable(new PackageIdxarrayExampleBookingsPlsqlArray(theLog, (Bookings.createBookingsArrayFromBookingsAttrsArray(paramPBookingTable))));
517    
518    // Call procedure
519    theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray: Call procedure");
520    theService.executeProc();
521    
522    // Unload results
523    theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray: Unload results");
524    serviceOutput = theService.getParamPStatusMessage();
525    
526    if (alwaysReleaseResources)
527      {
528      // Hand back DB connection...
529      releaseResources();
530      }
531    
532    
533    theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray Returning Data");
534    return(serviceOutput);
535    }
536  catch (com.orindasoft.pub.CSException e)
537    {
538    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
539    theLog.error("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray Failed:");
540    theLog.error(e.getMessage());
541    throw (e2);
542    }
543  }
544/** 
545* Call Class PackageIdxarrayExampleGetPlsqlArrayOfFlights as a service
546* @param String paramPCity VARCHAR2
547* @return FlightsAttrs[]
548* @throws DAOFactoryServiceException
549*/
550// JSR-181 support - make this method part of a web service
551@WebMethod
552public FlightsAttrs[] servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights
553    (@WebParam(name="paramPCity") String paramPCity) throws DAOFactoryServiceException
554  {
555  try
556    {
557    theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights Starting");
558    
559    // Declare variable to hold result of service
560    FlightsAttrs[] serviceOutput;
561    
562    // Get instance of created class
563    theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights: Get instance of created class");
564    com.orindasoft.demo.generated.plsql.PackageIdxarrayExampleGetPlsqlArrayOfFlights theService = getPackageIdxarrayExampleGetPlsqlArrayOfFlightsPlSqlDAO();
565    
566    // Set parameters
567    theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights: Set parameters");
568    theService.setParamPCity(paramPCity);
569    
570    // Call procedure
571    theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights: Call procedure");
572    theService.executeProc();
573    
574    // Unload results
575    theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights: Unload results");
576    serviceOutput = theService.getParamPFlightsFrom().getCurrentValues();
577    
578    if (alwaysReleaseResources)
579      {
580      // Hand back DB connection...
581      releaseResources();
582      }
583    
584    
585    theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights Returning Data");
586    return(serviceOutput);
587    }
588  catch (com.orindasoft.pub.CSException e)
589    {
590    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
591    theLog.error("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights Failed:");
592    theLog.error(e.getMessage());
593    throw (e2);
594    }
595  }
596/** 
597* Call Class ChangeFlightDates as a service
598* @return void
599* @throws DAOFactoryServiceException
600*/
601// JSR-181 support - make this method part of a web service
602@WebMethod
603public void serviceSqlChangeFlightDates() throws DAOFactoryServiceException
604  {
605  try
606    {
607    theLog.debug("serviceSqlChangeFlightDates Starting");
608    
609    // Get instance of created class
610    theLog.debug("serviceSqlChangeFlightDates: Get instance of created class");
611    com.orindasoft.demo.generated.sql.ChangeFlightDates theService = getChangeFlightDatesSqlDAO();
612    
613    
614    // Call statement
615    theLog.debug("serviceSqlChangeFlightDates: Call statement");
616    theService.executeCall();
617    
618    
619    if (alwaysReleaseResources)
620      {
621      // Hand back DB connection...
622      releaseResources();
623      }
624    
625    }
626  catch (com.orindasoft.pub.CSException e)
627    {
628    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
629    theLog.error("serviceSqlChangeFlightDates Failed:");
630    theLog.error(e.getMessage());
631    throw (e2);
632    }
633  }
634/** 
635* Call Class CustcomerAdd as a service
636* @param String Paramname STRING
637* @param String Paramaddress STRING
638* @param String Paramcity STRING
639* @param String Paramstate STRING
640* @param double Paramzip NUMBER
641* @param java.util.Date Parambdate DATE
642* @param String Paramphone STRING
643* @return void
644* @throws DAOFactoryServiceException
645*/
646// JSR-181 support - make this method part of a web service
647@WebMethod
648public void serviceSqlCustcomerAdd
649    (@WebParam(name="Paramname") String Paramname
650    ,@WebParam(name="Paramaddress") String Paramaddress
651    ,@WebParam(name="Paramcity") String Paramcity
652    ,@WebParam(name="Paramstate") String Paramstate
653    ,@WebParam(name="Paramzip") double Paramzip
654    ,@WebParam(name="Parambdate") java.util.Date Parambdate
655    ,@WebParam(name="Paramphone") String Paramphone) throws DAOFactoryServiceException
656  {
657  try
658    {
659    theLog.debug("serviceSqlCustcomerAdd Starting");
660    
661    // Get instance of created class
662    theLog.debug("serviceSqlCustcomerAdd: Get instance of created class");
663    com.orindasoft.demo.generated.sql.CustcomerAdd theService = getCustcomerAddSqlDAO();
664    
665    theService.setParamname(Paramname);
666    theService.setParamaddress(Paramaddress);
667    theService.setParamcity(Paramcity);
668    theService.setParamstate(Paramstate);
669    theService.setParamzip(Paramzip);
670    theService.setParambdate(Parambdate);
671    theService.setParamphone(Paramphone);
672    
673    // Call statement
674    theLog.debug("serviceSqlCustcomerAdd: Call statement");
675    theService.executeCall();
676    
677    
678    if (alwaysReleaseResources)
679      {
680      // Hand back DB connection...
681      releaseResources();
682      }
683    
684    }
685  catch (com.orindasoft.pub.CSException e)
686    {
687    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
688    theLog.error("serviceSqlCustcomerAdd Failed:");
689    theLog.error(e.getMessage());
690    throw (e2);
691    }
692  }
693/** 
694* Call Class CustomerDelete as a service
695* @param String ParamParam1 STRING
696* @return void
697* @throws DAOFactoryServiceException
698*/
699// JSR-181 support - make this method part of a web service
700@WebMethod
701public void serviceSqlCustomerDelete
702    (@WebParam(name="ParamParam1") String ParamParam1) throws DAOFactoryServiceException
703  {
704  try
705    {
706    theLog.debug("serviceSqlCustomerDelete Starting");
707    
708    // Get instance of created class
709    theLog.debug("serviceSqlCustomerDelete: Get instance of created class");
710    com.orindasoft.demo.generated.sql.CustomerDelete theService = getCustomerDeleteSqlDAO();
711    
712    theService.setParamParam1(ParamParam1);
713    
714    // Call statement
715    theLog.debug("serviceSqlCustomerDelete: Call statement");
716    theService.executeCall();
717    
718    
719    if (alwaysReleaseResources)
720      {
721      // Hand back DB connection...
722      releaseResources();
723      }
724    
725    }
726  catch (com.orindasoft.pub.CSException e)
727    {
728    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
729    theLog.error("serviceSqlCustomerDelete Failed:");
730    theLog.error(e.getMessage());
731    throw (e2);
732    }
733  }
734/** 
735* Call Class CustomerUpdate as a service
736* @param String Paramaddress STRING
737* @param String Paramcity STRING
738* @param String Paramstate STRING
739* @param double Paramzip NUMBER
740* @param java.util.Date Parambdate DATE
741* @param String Paramphone STRING
742* @param String Paramname STRING
743* @return void
744* @throws DAOFactoryServiceException
745*/
746// JSR-181 support - make this method part of a web service
747@WebMethod
748public void serviceSqlCustomerUpdate
749    (@WebParam(name="Paramaddress") String Paramaddress
750    ,@WebParam(name="Paramcity") String Paramcity
751    ,@WebParam(name="Paramstate") String Paramstate
752    ,@WebParam(name="Paramzip") double Paramzip
753    ,@WebParam(name="Parambdate") java.util.Date Parambdate
754    ,@WebParam(name="Paramphone") String Paramphone
755    ,@WebParam(name="Paramname") String Paramname) throws DAOFactoryServiceException
756  {
757  try
758    {
759    theLog.debug("serviceSqlCustomerUpdate Starting");
760    
761    // Get instance of created class
762    theLog.debug("serviceSqlCustomerUpdate: Get instance of created class");
763    com.orindasoft.demo.generated.sql.CustomerUpdate theService = getCustomerUpdateSqlDAO();
764    
765    theService.setParamaddress(Paramaddress);
766    theService.setParamcity(Paramcity);
767    theService.setParamstate(Paramstate);
768    theService.setParamzip(Paramzip);
769    theService.setParambdate(Parambdate);
770    theService.setParamphone(Paramphone);
771    theService.setParamname(Paramname);
772    
773    // Call statement
774    theLog.debug("serviceSqlCustomerUpdate: Call statement");
775    theService.executeCall();
776    
777    
778    if (alwaysReleaseResources)
779      {
780      // Hand back DB connection...
781      releaseResources();
782      }
783    
784    }
785  catch (com.orindasoft.pub.CSException e)
786    {
787    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
788    theLog.error("serviceSqlCustomerUpdate Failed:");
789    theLog.error(e.getMessage());
790    throw (e2);
791    }
792  }
793/** 
794* Call Class GetFlights as a service
795* @param String Paramcity STRING
796* @return com.orindasoft.demo.generated.sql.GetFlightsCursorAttr[]
797* @throws DAOFactoryServiceException
798*/
799// JSR-181 support - make this method part of a web service
800@WebMethod
801public com.orindasoft.demo.generated.sql.GetFlightsCursorAttr[] serviceSqlGetFlights
802    (@WebParam(name="Paramcity") String Paramcity) throws DAOFactoryServiceException
803  {
804  try
805    {
806    theLog.debug("serviceSqlGetFlights Starting");
807    
808    // Declare variable to hold result of service
809    com.orindasoft.demo.generated.sql.GetFlightsCursorAttr[] serviceOutput;
810    
811    // Get instance of created class
812    theLog.debug("serviceSqlGetFlights: Get instance of created class");
813    com.orindasoft.demo.generated.sql.GetFlights theService = getGetFlightsSqlDAO();
814    
815    // Set parameters
816    theLog.debug("serviceSqlGetFlights: Set parameters");
817    theService.setParamcity(Paramcity);
818    theService.setParamcity(Paramcity);
819    
820    // Call Query
821    theLog.debug("serviceSqlGetFlights: Call Query");
822    serviceOutput = (com.orindasoft.demo.generated.sql.GetFlightsCursorAttr[])com.orindasoft.demo.generated.sql.GetFlights.getArrayFromReadOnlyRowSet(theService.executeQuery(), theLog, true );
823    
824    // Unload results
825    theLog.debug("serviceSqlGetFlights: Unload results");
826    
827    if (alwaysReleaseResources)
828      {
829      // Hand back DB connection...
830      releaseResources();
831      }
832    
833    
834    theLog.debug("serviceSqlGetFlights Returning Data");
835    return(serviceOutput);
836    }
837  catch (com.orindasoft.pub.CSException e)
838    {
839    DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
840    theLog.error("serviceSqlGetFlights Failed:");
841    theLog.error(e.getMessage());
842    throw (e2);
843    }
844  }
845/**
846 * Turns a file into a Byte array. The file is deleted.
847 * @param theFile A file we wish to load into a Byte Array
848 * @return A Byte array containing the contents of the file
849 * @throws CSException
850 */
851protected byte[] loadFileIntoByteArray(java.io.File theFile) throws CSException
852  {
853  byte[] newArray = null;
854  try
855    {
856    if (theFile != null && theFile.exists() && theFile.length() > 0)
857      {
858      if (theFile.length() > Integer.MAX_VALUE)
859        {
860        throw new CSException("loadFileIntoByteArray: File " 
861                             + theFile.getAbsolutePath()
862                             + " is too big to be turned into a Byte array");
863        }
864         
865      theLog.debug("loadFileIntoByteArray: Starting to load " 
866                       + theFile.length()
867                       + " from temp file " + theFile.getAbsolutePath() + " into byte array");
868
869      newArray = new byte[(int)theFile.length()];
870      java.io.BufferedInputStream theInputStream = new java.io.BufferedInputStream(new java.io.FileInputStream(theFile));
871      theInputStream.read(newArray);
872      theInputStream.close();
873      theLog.debug("loadFileIntoByteArray: Finished loading byte array");
874      }
875    else
876      {
877      theLog.debug("loadFileIntoByteArray: Turning empty/null file into byte array"); 
878      }
879     
880    }
881  catch (java.io.IOException e)
882    {
883    throw new CSException("loadFileIntoByteArray:" + e.getMessage());
884    }
885
886  return (newArray);
887  }
888
889
890/**
891 * Turns a file into a Byte array or uses an existing byte array. The file is deleted.
892 * @param theFile A file we wish to load into a Byte Array
893 * @param theArray An existing Byte Array that may or not have the data we want
894 * @return A Byte array containing the contents of the file or theArray
895 * @throws CSException
896 */
897protected byte[] loadFileIntoByteArray(java.io.File theFile, byte[] theArray) throws CSException
898  {
899  if (theArray != null)
900    {
901    return(theArray);
902    }
903  return (loadFileIntoByteArray(theFile));
904  }
905
906
907/**
908 * Turns a Byte array into a File. 
909 * @param theBytes A Byte array
910 * @return A File containing theBytes
911 * @throws CSException
912 */
913protected java.io.File loadByteArrayIntoFile(byte[] theBytes) throws CSException
914  {
915  return(com.orindasoft.pub.IOUtils.loadByteArrayIntoFile(theBytes, tempFilePrefix, tempFileSuffix, tempFileDir.getAbsolutePath(), theLog));
916  }
917    
918/**
919* Turns a ReadOnlyRowSet into a WsdlRowSet. 
920* @param com.orindasoft.pub.ReadOnlyRowSet theRowSet A query
921* @return WsdlRowSet A data structure that can be serialized
922* @throws CSException
923*/
924protected WsdlRowSet createWSDLRowset(com.orindasoft.pub.ReadOnlyRowSet theRowSet) throws CSException
925  {
926  WsdlRowSet newRowSet = new WsdlRowSet();
927  
928  if (theRowSet == null)
929    {
930    return(newRowSet);
931    }
932  
933  newRowSet.columnNames = theRowSet.getColumnNamesAsStringArray();
934  newRowSet.rows = new WsdlRow[theRowSet.size()];
935  
936  for (int i=0; i < theRowSet.size(); i++)
937    {
938    try
939      {
940      theRowSet.setCurrentRowNumber(i);
941      newRowSet.rows[i] = new WsdlRow();
942      Object[] currentRow  = theRowSet.getCurrentRow();
943      newRowSet.rows[i].rowColumns = new WsdlElement[currentRow.length];
944       
945      for (int j=0; j < currentRow.length; j++)
946        {
947        newRowSet.rows[i].rowColumns[j] = new WsdlElement();
948        newRowSet.rows[i].rowColumns[j].column = currentRow[j];
949         
950        // Turn Files into Byte arrays
951        if (newRowSet.rows[i].rowColumns[j].column instanceof java.io.File)
952          {
953          java.io.File tempFile = (java.io.File)newRowSet.rows[i].rowColumns[j].column;
954          if (tempFile.exists())
955            {
956            newRowSet.rows[i].rowColumns[j].column = loadFileIntoByteArray(tempFile);
957            tempFile.delete();
958            }
959          else
960            {
961            newRowSet.rows[i].rowColumns[j].column = new byte[0];
962            }
963          }
964        // Turn Oracle's Interval data types into Strings
965        // This code will not compile if you use a JDBC driver prior to Oracle 10g
966        else if (   newRowSet.rows[i].rowColumns[j].column instanceof oracle.sql.INTERVALDS 
967                 || newRowSet.rows[i].rowColumns[j].column instanceof oracle.sql.INTERVALYM)
968          {
969          newRowSet.rows[i].rowColumns[j].column = newRowSet.rows[i].rowColumns[j].column.toString().trim();
970          }
971        // Turn Oracle's Timestamp data types into Strings
972        // This code will not compile if you use a JDBC driver prior to Oracle 9i
973        else if (   newRowSet.rows[i].rowColumns[j].column instanceof oracle.sql.TIMESTAMP)
974          {
975          newRowSet.rows[i].rowColumns[j].column = oracle.sql.TIMESTAMP.toString(((oracle.sql.TIMESTAMP)newRowSet.rows[i].rowColumns[j].column).getBytes());
976          }
977        else if (   newRowSet.rows[i].rowColumns[j].column instanceof oracle.sql.TIMESTAMPTZ)
978          {
979          try 
980            {
981            newRowSet.rows[i].rowColumns[j].column = oracle.sql.TIMESTAMPTZ.toString(theConnection,((oracle.sql.TIMESTAMPTZ)newRowSet.rows[i].rowColumns[j].column).getBytes());
982            }
983          catch (java.sql.SQLException e)
984            {
985            theLog.error("Row " + i + " Column " + newRowSet.columnNames[j] +": SQLException thrown:"); 
986            theLog.error(e);   
987            throw new CSException(e.getMessage());
988            }
989          }
990        else if (   newRowSet.rows[i].rowColumns[j].column instanceof oracle.sql.TIMESTAMPLTZ)
991          {
992          try 
993            {
994            newRowSet.rows[i].rowColumns[j].column = oracle.sql.TIMESTAMPLTZ.toString(theConnection,((oracle.sql.TIMESTAMPLTZ)newRowSet.rows[i].rowColumns[j].column).getBytes());
995            }
996          catch (java.sql.SQLException e)
997            {
998            theLog.error("Row " + i + " Column " + newRowSet.columnNames[j] +": SQLException thrown:"); 
999            theLog.error(e);   
000            throw new CSException(e.getMessage());
001            }
002          }
003        // If a ReadOnlyRowSet contains a 'bad' BFILE there will be an Exception instead of a File object
004        else if (newRowSet.rows[i].rowColumns[j].column instanceof CSException)
005          {
006          theLog.error("Row " + i + " Column " + newRowSet.columnNames[j] +": CSException found instead of LOB.:"); 
007          theLog.error((CSException)newRowSet.rows[i].rowColumns[j].column);
008          throw((CSException)newRowSet.rows[i].rowColumns[j].column);
009          }
010         
011        }
012      }
013    catch (com.orindasoft.pub.CSNoDataInRowSetException e)
014      {
015      newRowSet.rows[i] = null;
016      }
017    }
018  return(newRowSet);
019  }
020 
021/** 
022* Executes a DDL statement
023* @since OrindaBuild 5.1.2557 
024*/ 
025private void executeImmediate(String ddl, int allowableErrorCode) throws CSException
026  {                                                                   
027  java.sql.CallableStatement theStatement = null;                                      
028                                                                   
029  if (theConnection == null)
030    {                                  
031    throw (new CSException("Not Connected - Statement can not be issued"));  
032    }                      
033                                                                   
034  // Parse execute immediate request...                          
035  try                                                              
036    {                                                                
037    theLog.info(ddl);
038    theLog.debug("executeImmediate - Starting to parse statement");
039    theStatement = theConnection.prepareCall(ddl);    
040    theLog.debug("executeImmediate - Finished parsing statement");
041    }                                                                  
042  catch (java.sql.SQLException e)                                    
043    {                                                                   
044    theLog.error("executeImmediate: Prepare Statement failed with " + e.toString());
045    CSDBException e2 = new CSDBException(e.getErrorCode(),e.getMessage(),"executeImmediate","DAOFactory");
046    throw (e2);   
047    }       
048                                                                
049  try                                                              
050    {                                                                
051    theStatement.execute();
052    theStatement.close();
053    }
054  catch (java.sql.SQLException e)
055    {
056    if (e.getErrorCode() != allowableErrorCode)
057      {                                  
058      theLog.error("DAOFactory - Execute Immediate Failed:");
059      theLog.error(e);
060      CSDBException e2 = new CSDBException(e.getErrorCode(),e.getMessage(),"executeImmediate","DAOFactory");
061      throw(e2);
062      }
063    }
064  }                      
065 
066/** 
067* Creates generated Oracle TYPE objects that are needed to 
068* access PL/SQL Package Array Parameters.
069* @since OrindaBuild 5.1.2557
070*/ 
071public void createExtraTypeObjects() throws CSException
072  {
073  confirmConnection("createExtraTypeObjects");
074   
075  executeImmediate("CREATE OR REPLACE TYPE OSOFT46ND2_T AS OBJECT" 
076   
077                 + " (COL_0 VARCHAR2(16)"
078   
079                 + " ,COL_1 VARCHAR2(64)"
080   
081                 + " ,COL_2 NUMBER"
082   
083                 + " ,COL_3 DATE"
084   
085                 + " ,COL_4 VARCHAR2(4))",SqlUtils.TYPE_HAS_DEPENDENTS);
086   
087  executeImmediate("CREATE OR REPLACE TYPE OSOFT46ND2_A  AS TABLE OF OSOFT46ND2_T;",SqlUtils.TYPE_HAS_DEPENDENTS); 
088  executeImmediate("CREATE OR REPLACE TYPE OSOFT446NDD6_T AS OBJECT" 
089   
090                 + " (COL_0 VARCHAR2(16)"
091   
092                 + " ,COL_1 VARCHAR2(16)"
093   
094                 + " ,COL_2 VARCHAR2(64)"
095   
096                 + " ,COL_3 NUMBER"
097   
098                 + " ,COL_4 DATE"
099   
100                 + " ,COL_5 DATE"
101   
102                 + " ,COL_6 VARCHAR2(64))",SqlUtils.TYPE_HAS_DEPENDENTS);
103   
104  executeImmediate("CREATE OR REPLACE TYPE OSOFT446NDD6_A  AS TABLE OF OSOFT446NDD6_T;",SqlUtils.TYPE_HAS_DEPENDENTS); 
105   
106  }
107 
108/** 
109* Removes generated Oracle TYPE objects that are needed to 
110* access PL/SQL Package Array Parameters.
111* @since OrindaBuild 5.1.2557
112*/ 
113public void dropExtraTypeObjects() throws CSException
114  {
115  confirmConnection("dropExtraTypeObjects");
116   
117  executeImmediate("DROP TYPE OSOFT46ND2_A",SqlUtils.OBJECT_DOES_NOT_EXIST); 
118   
119  executeImmediate("DROP TYPE OSOFT46ND2_T",SqlUtils.OBJECT_DOES_NOT_EXIST); 
120   
121  executeImmediate("DROP TYPE OSOFT446NDD6_A",SqlUtils.OBJECT_DOES_NOT_EXIST); 
122   
123  executeImmediate("DROP TYPE OSOFT446NDD6_T",SqlUtils.OBJECT_DOES_NOT_EXIST); 
124   
125  }
126 
127/** 
128* Removes generated Oracle TYPE objects that appear to have 
129* been created by OrindaBuild, even if they aren't used by this generated service.
130* @since OrindaBuild 5.1.2557
131*/ 
132public void dropAllExtraTypeObjects() throws CSException
133  {
134   
135  final String DROP_ALL_TYPES_BLOCK = 
136      "DECLARE\n" 
137    + "--\n"  
138    + "CURSOR typecur IS\n" 
139    + "SELECT 'DROP TYPE '||type_name cmd\n" 
140    + "FROM user_types\n"
141    + "WHERE type_name LIKE '" + tempFilePrefix.toUpperCase()  + "%'\n" 
142    + "ORDER BY DECODE (typecode,'COLLECTION',1,2), type_name;\n"
143    + "--\n" 
144    + "BEGIN\n"  
145    + "--\n"
146    + "FOR typerec IN typecur LOOP\n" 
147    + "--\n" 
148    + "  EXECUTE IMMEDIATE typerec.cmd;\n" 
149    + "--\n" 
150    + "END LOOP;\n" 
151    + "--\n" 
152    + "END;\n"; 
153   
154  confirmConnection("dropAllExtraTypeObjects");
155  executeImmediate(DROP_ALL_TYPES_BLOCK,0); 
156   
157  }
158} // Generated by OrindaBuild 6.0.2699                                                  
159