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 import javax.jws.*;
12 @WebService(endpointInterface = "com.orindasoft.demo.generated.DAOFactoryServiceInterface")
15
36 public class DAOFactoryServiceImpl extends DAOFactory implements OracleResourceUser, DAOFactoryServiceInterface
37 {
38
39
45 protected boolean alwaysReleaseResources = false;
46
47
52 protected boolean minValueIsNULL = false;
53
54
59 protected boolean castNullToNewObject = false;
60
61
65 public DAOFactoryServiceImpl()
66 {
67 super();
68 }
69
70
77 public DAOFactoryServiceImpl(java.sql.Connection theConnection, LogInterface theLog)
78 {
79 super(theConnection,theLog);
80 }
81
82
88 public DAOFactoryServiceImpl(LogInterface theLog)
89 {
90 super(theLog);
91 }
92
93
94
99 public void setAlwaysReleaseResourcesFlag(boolean alwaysReleaseResources)
100 {
101 this.alwaysReleaseResources = alwaysReleaseResources;
102 }
103
104
105
110public void setMinValueIsNull(boolean minValueIsNULL)
111 {
112 this.minValueIsNULL = minValueIsNULL;
113 }
114
115
116
121public void setCastNullToNewObject(boolean castNullToNewObject)
122 {
123 this.castNullToNewObject = castNullToNewObject;
124 }
125
126
129public long serviceSequenceSequentialNumberGenerator() throws DAOFactoryServiceException
130 {
131 try
132 {
133 com.orindasoft.demo.generated.sequence.SequentialNumberGenerator theService = getSequentialNumberGeneratorSequenceDAO();
134
135 return (theService.getNext());
136 }
137 catch (com.orindasoft.pub.CSException e)
138 {
139 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
140 theLog.error(e.getMessage());
141 throw (e2);
142 }
143 }
144
151@WebMethod
153public boolean servicePlsqlCursorExampleDirectFlightAvailable
154 (@WebParam(name="paramPFromcity") String paramPFromcity
155 ,@WebParam(name="paramPTocity") String paramPTocity) throws DAOFactoryServiceException
156 {
157 try
158 {
159 theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable Starting");
160
161 boolean serviceOutput;
163
164 theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable: Get instance of created class");
166 com.orindasoft.demo.generated.plsql.CursorExampleDirectFlightAvailable theService = getCursorExampleDirectFlightAvailablePlSqlDAO();
167
168 theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable: Set parameters");
170 theService.setParamPFromcity(paramPFromcity);
171 theService.setParamPTocity(paramPTocity);
172
173 theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable: Call procedure");
175 theService.executeProc();
176
177 theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable: Unload results");
179 serviceOutput = theService.getFunctionResultBoolean();
180
181 theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable Returning Data");
182 return(serviceOutput);
183 }
184 catch (com.orindasoft.pub.CSException e)
185 {
186 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
187 theLog.error("servicePlsqlCursorExampleDirectFlightAvailable Failed:");
188 theLog.error(e.getMessage());
189 throw (e2);
190 }
191 finally
192 {
193
194 if (alwaysReleaseResources)
195 {
196 releaseResources();
198 }
199
200 }
201 }
202
210@WebMethod
212public com.orindasoft.demo.generated.plsql.CursorExampleFlightsRefcursorTypeAttrs[] servicePlsqlCursorExampleFindDirectFlights
213 (@WebParam(name="paramPFromcity") String paramPFromcity
214 ,@WebParam(name="paramPTocity") String paramPTocity
215 ,@WebParam(name="paramPOrderby") double paramPOrderby) throws DAOFactoryServiceException
216 {
217 try
218 {
219 theLog.debug("servicePlsqlCursorExampleFindDirectFlights Starting");
220
221 com.orindasoft.demo.generated.plsql.CursorExampleFlightsRefcursorTypeAttrs[] serviceOutput;
223
224 theLog.debug("servicePlsqlCursorExampleFindDirectFlights: Get instance of created class");
226 com.orindasoft.demo.generated.plsql.CursorExampleFindDirectFlights theService = getCursorExampleFindDirectFlightsPlSqlDAO();
227
228 theService.setUseByteArraysForLongsAndLOBS(true);
230
231 theLog.debug("servicePlsqlCursorExampleFindDirectFlights: Set parameters");
233 theService.setParamPFromcity(paramPFromcity);
234 theService.setParamPTocity(paramPTocity);
235
236 if (minValueIsNULL && paramPOrderby == Double.MIN_VALUE)
237 {
238 theService.setParamPOrderbyToNull();
239 }
240 else
241 {
242 theService.setParamPOrderby(paramPOrderby);
243 }
244
245
246 theLog.debug("servicePlsqlCursorExampleFindDirectFlights: Call procedure");
248 theService.executeProc();
249
250 theLog.debug("servicePlsqlCursorExampleFindDirectFlights: Unload results");
252 serviceOutput = (CursorExampleFlightsRefcursorTypeAttrs[])CursorExampleFlightsRefcursorType.createCursorExampleFlightsRefcursorTypeArrayFromRowSet(theService.getParamPFlightlist(),theLog);
253
254 theLog.debug("servicePlsqlCursorExampleFindDirectFlights Returning Data");
255 return(serviceOutput);
256 }
257 catch (com.orindasoft.pub.CSException e)
258 {
259 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
260 theLog.error("servicePlsqlCursorExampleFindDirectFlights Failed:");
261 theLog.error(e.getMessage());
262 throw (e2);
263 }
264 finally
265 {
266
267 if (alwaysReleaseResources)
268 {
269 releaseResources();
271 }
272
273 }
274 }
275
280@WebMethod
282public com.orindasoft.demo.generated.plsql.CursorExampleGetlistsReturn servicePlsqlCursorExampleGetlists() throws DAOFactoryServiceException
283 {
284 try
285 {
286 theLog.debug("servicePlsqlCursorExampleGetlists Starting");
287
288 com.orindasoft.demo.generated.plsql.CursorExampleGetlistsReturn serviceOutput = new com.orindasoft.demo.generated.plsql.CursorExampleGetlistsReturn();
290
291 theLog.debug("servicePlsqlCursorExampleGetlists: Get instance of created class");
293 com.orindasoft.demo.generated.plsql.CursorExampleGetlists theService = getCursorExampleGetlistsPlSqlDAO();
294
295 theService.setUseByteArraysForLongsAndLOBS(true);
297
298 theLog.debug("servicePlsqlCursorExampleGetlists: Set parameters");
300
301 theLog.debug("servicePlsqlCursorExampleGetlists: Call procedure");
303 theService.executeProc();
304
305 theLog.debug("servicePlsqlCursorExampleGetlists: Unload results");
307 serviceOutput.setParamPAirlineListing((CursorExampleAirlineRefcursorTypeAttrs[])CursorExampleAirlineRefcursorType.createCursorExampleAirlineRefcursorTypeArrayFromRowSet(theService.getParamPAirlineListing(),theLog));
308 serviceOutput.setParamPAirportListing((CursorExampleAirportRefcursorTypeAttrs[])CursorExampleAirportRefcursorType.createCursorExampleAirportRefcursorTypeArrayFromRowSet(theService.getParamPAirportListing(),theLog));
309 serviceOutput.setParamPAircraftListing((CursorExampleAircraftRefcursorTypeAttrs[])CursorExampleAircraftRefcursorType.createCursorExampleAircraftRefcursorTypeArrayFromRowSet(theService.getParamPAircraftListing(),theLog));
310
311 theLog.debug("servicePlsqlCursorExampleGetlists Returning Data");
312 return(serviceOutput);
313 }
314 catch (com.orindasoft.pub.CSException e)
315 {
316 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
317 theLog.error("servicePlsqlCursorExampleGetlists Failed:");
318 theLog.error(e.getMessage());
319 throw (e2);
320 }
321 finally
322 {
323
324 if (alwaysReleaseResources)
325 {
326 releaseResources();
328 }
329
330 }
331 }
332
339@WebMethod
341public String servicePlsqlObjectArrayExampleAddBookingsObjectArray
342 (@WebParam(name="paramPCustomer") CustomersAttrs paramPCustomer
343 ,@WebParam(name="paramPBookingTable") BookingsTypeAttrs[] paramPBookingTable) throws DAOFactoryServiceException
344 {
345 try
346 {
347 theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray Starting");
348
349 if (castNullToNewObject)
351 {
352 if (paramPCustomer == null) paramPCustomer = new CustomersAttrs();
353 if (paramPBookingTable == null) paramPBookingTable = new BookingsTypeAttrs[0];
354 }
355
356 String serviceOutput;
358
359 theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray: Get instance of created class");
361 com.orindasoft.demo.generated.plsql.ObjectArrayExampleAddBookingsObjectArray theService = getObjectArrayExampleAddBookingsObjectArrayPlSqlDAO();
362
363 theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray: Set parameters");
365
366 if (paramPCustomer != null)
367 {
368 theService.setParamPCustomer(Customers.createCustomersFromCustomersAttrs(paramPCustomer));
369 }
370 else
371 {
372 theService.setParamPCustomerToNull();
373 }
374
375 if (paramPBookingTable != null)
376 {
377 theService.setParamPBookingTable(new BookingsTable(theLog, (BookingsType.createBookingsTypeArrayFromBookingsTypeAttrsArray(paramPBookingTable))));
378 }
379 else
380 {
381 theService.setParamPBookingTableToNull();
382 }
383
384 theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray: Call procedure");
386 theService.executeProc();
387
388 theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray: Unload results");
390 serviceOutput = theService.getParamPStatusMessage();
391
392 theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray Returning Data");
393 return(serviceOutput);
394 }
395 catch (com.orindasoft.pub.CSException e)
396 {
397 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
398 theLog.error("servicePlsqlObjectArrayExampleAddBookingsObjectArray Failed:");
399 theLog.error(e.getMessage());
400 throw (e2);
401 }
402 finally
403 {
404
405 if (alwaysReleaseResources)
406 {
407 releaseResources();
409 }
410
411 }
412 }
413
419@WebMethod
421public FlightsTypeAttrs[] servicePlsqlObjectArrayExampleGetObjectArrayOfFlights
422 (@WebParam(name="paramPCity") String paramPCity) throws DAOFactoryServiceException
423 {
424 try
425 {
426 theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights Starting");
427
428 FlightsTypeAttrs[] serviceOutput;
430
431 theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights: Get instance of created class");
433 com.orindasoft.demo.generated.plsql.ObjectArrayExampleGetObjectArrayOfFlights theService = getObjectArrayExampleGetObjectArrayOfFlightsPlSqlDAO();
434
435 theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights: Set parameters");
437 theService.setParamPCity(paramPCity);
438
439 theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights: Call procedure");
441 theService.executeProc();
442
443 theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights: Unload results");
445 serviceOutput = theService.getParamPFlightsFrom().getCurrentValues();
446
447 theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights Returning Data");
448 return(serviceOutput);
449 }
450 catch (com.orindasoft.pub.CSException e)
451 {
452 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
453 theLog.error("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights Failed:");
454 theLog.error(e.getMessage());
455 throw (e2);
456 }
457 finally
458 {
459
460 if (alwaysReleaseResources)
461 {
462 releaseResources();
464 }
465
466 }
467 }
468
475@WebMethod
477public String servicePlsqlPackageArrayExampleAddBookingsPlsqlArray
478 (@WebParam(name="paramPCustomer") CustomersAttrs paramPCustomer
479 ,@WebParam(name="paramPBookingTable") BookingsAttrs[] paramPBookingTable) throws DAOFactoryServiceException
480 {
481 try
482 {
483 theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray Starting");
484
485 if (castNullToNewObject)
487 {
488 if (paramPCustomer == null) paramPCustomer = new CustomersAttrs();
489 if (paramPBookingTable == null) paramPBookingTable = new BookingsAttrs[0];
490 }
491
492 String serviceOutput;
494
495 theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray: Get instance of created class");
497 com.orindasoft.demo.generated.plsql.PackageArrayExampleAddBookingsPlsqlArray theService = getPackageArrayExampleAddBookingsPlsqlArrayPlSqlDAO();
498
499 theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray: Set parameters");
501
502 if (paramPCustomer != null)
503 {
504 theService.setParamPCustomer(Customers.createCustomersFromCustomersAttrs(paramPCustomer));
505 }
506 else
507 {
508 theService.setParamPCustomerToNull();
509 }
510
511 if (paramPBookingTable != null)
512 {
513 theService.setParamPBookingTable(new PackageArrayExampleBookingsPlsqlArray(theLog, (Bookings.createBookingsArrayFromBookingsAttrsArray(paramPBookingTable))));
514 }
515 else
516 {
517 theService.setParamPBookingTableToNull();
518 }
519
520 theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray: Call procedure");
522 theService.executeProc();
523
524 theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray: Unload results");
526 serviceOutput = theService.getParamPStatusMessage();
527
528 theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray Returning Data");
529 return(serviceOutput);
530 }
531 catch (com.orindasoft.pub.CSException e)
532 {
533 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
534 theLog.error("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray Failed:");
535 theLog.error(e.getMessage());
536 throw (e2);
537 }
538 finally
539 {
540
541 if (alwaysReleaseResources)
542 {
543 releaseResources();
545 }
546
547 }
548 }
549
555@WebMethod
557public FlightsAttrs[] servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights
558 (@WebParam(name="paramPCity") String paramPCity) throws DAOFactoryServiceException
559 {
560 try
561 {
562 theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights Starting");
563
564 FlightsAttrs[] serviceOutput;
566
567 theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights: Get instance of created class");
569 com.orindasoft.demo.generated.plsql.PackageArrayExampleGetPlsqlArrayOfFlights theService = getPackageArrayExampleGetPlsqlArrayOfFlightsPlSqlDAO();
570
571 theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights: Set parameters");
573 theService.setParamPCity(paramPCity);
574
575 theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights: Call procedure");
577 theService.executeProc();
578
579 theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights: Unload results");
581 serviceOutput = theService.getParamPFlightsFrom().getCurrentValues();
582
583 theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights Returning Data");
584 return(serviceOutput);
585 }
586 catch (com.orindasoft.pub.CSException e)
587 {
588 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
589 theLog.error("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights Failed:");
590 theLog.error(e.getMessage());
591 throw (e2);
592 }
593 finally
594 {
595
596 if (alwaysReleaseResources)
597 {
598 releaseResources();
600 }
601
602 }
603 }
604
611@WebMethod
613public String servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray
614 (@WebParam(name="paramPCustomer") CustomersAttrs paramPCustomer
615 ,@WebParam(name="paramPBookingTable") BookingsAttrs[] paramPBookingTable) throws DAOFactoryServiceException
616 {
617 try
618 {
619 theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray Starting");
620
621 if (castNullToNewObject)
623 {
624 if (paramPCustomer == null) paramPCustomer = new CustomersAttrs();
625 if (paramPBookingTable == null) paramPBookingTable = new BookingsAttrs[0];
626 }
627
628 String serviceOutput;
630
631 theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray: Get instance of created class");
633 com.orindasoft.demo.generated.plsql.PackageIdxarrayExampleAddBookingsPlsqlArray theService = getPackageIdxarrayExampleAddBookingsPlsqlArrayPlSqlDAO();
634
635 theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray: Set parameters");
637
638 if (paramPCustomer != null)
639 {
640 theService.setParamPCustomer(Customers.createCustomersFromCustomersAttrs(paramPCustomer));
641 }
642 else
643 {
644 theService.setParamPCustomerToNull();
645 }
646
647 if (paramPBookingTable != null)
648 {
649 theService.setParamPBookingTable(new PackageIdxarrayExampleBookingsPlsqlArray(theLog, (Bookings.createBookingsArrayFromBookingsAttrsArray(paramPBookingTable))));
650 }
651 else
652 {
653 theService.setParamPBookingTableToNull();
654 }
655
656 theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray: Call procedure");
658 theService.executeProc();
659
660 theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray: Unload results");
662 serviceOutput = theService.getParamPStatusMessage();
663
664 theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray Returning Data");
665 return(serviceOutput);
666 }
667 catch (com.orindasoft.pub.CSException e)
668 {
669 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
670 theLog.error("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray Failed:");
671 theLog.error(e.getMessage());
672 throw (e2);
673 }
674 finally
675 {
676
677 if (alwaysReleaseResources)
678 {
679 releaseResources();
681 }
682
683 }
684 }
685
691@WebMethod
693public FlightsAttrs[] servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights
694 (@WebParam(name="paramPCity") String paramPCity) throws DAOFactoryServiceException
695 {
696 try
697 {
698 theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights Starting");
699
700 FlightsAttrs[] serviceOutput;
702
703 theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights: Get instance of created class");
705 com.orindasoft.demo.generated.plsql.PackageIdxarrayExampleGetPlsqlArrayOfFlights theService = getPackageIdxarrayExampleGetPlsqlArrayOfFlightsPlSqlDAO();
706
707 theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights: Set parameters");
709 theService.setParamPCity(paramPCity);
710
711 theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights: Call procedure");
713 theService.executeProc();
714
715 theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights: Unload results");
717 serviceOutput = theService.getParamPFlightsFrom().getCurrentValues();
718
719 theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights Returning Data");
720 return(serviceOutput);
721 }
722 catch (com.orindasoft.pub.CSException e)
723 {
724 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
725 theLog.error("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights Failed:");
726 theLog.error(e.getMessage());
727 throw (e2);
728 }
729 finally
730 {
731
732 if (alwaysReleaseResources)
733 {
734 releaseResources();
736 }
737
738 }
739 }
740
745@WebMethod
747public void serviceSqlChangeFlightDates() throws DAOFactoryServiceException
748 {
749 try
750 {
751 theLog.debug("serviceSqlChangeFlightDates Starting");
752
753 theLog.debug("serviceSqlChangeFlightDates: Get instance of created class");
755 com.orindasoft.demo.generated.sql.ChangeFlightDates theService = getChangeFlightDatesSqlDAO();
756
757
758 theLog.debug("serviceSqlChangeFlightDates: Call statement");
760 theService.executeCall();
761
762 }
763 catch (com.orindasoft.pub.CSException e)
764 {
765 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
766 theLog.error("serviceSqlChangeFlightDates Failed:");
767 theLog.error(e.getMessage());
768 throw (e2);
769 }
770 finally
771 {
772
773 if (alwaysReleaseResources)
774 {
775 releaseResources();
777 }
778
779 }
780 }
781
793@WebMethod
795public void serviceSqlCustcomerAdd
796 (@WebParam(name="Paramname") String Paramname
797 ,@WebParam(name="Paramaddress") String Paramaddress
798 ,@WebParam(name="Paramcity") String Paramcity
799 ,@WebParam(name="Paramstate") String Paramstate
800 ,@WebParam(name="Paramzip") double Paramzip
801 ,@WebParam(name="Parambdate") java.util.Date Parambdate
802 ,@WebParam(name="Paramphone") String Paramphone) throws DAOFactoryServiceException
803 {
804 try
805 {
806 theLog.debug("serviceSqlCustcomerAdd Starting");
807
808 theLog.debug("serviceSqlCustcomerAdd: Get instance of created class");
810 com.orindasoft.demo.generated.sql.CustcomerAdd theService = getCustcomerAddSqlDAO();
811
812 theService.setParamname(Paramname);
813 theService.setParamaddress(Paramaddress);
814 theService.setParamcity(Paramcity);
815 theService.setParamstate(Paramstate);
816
817 if (minValueIsNULL && Paramzip == Double.MIN_VALUE)
818 {
819 theService.setParamzipToNull();
820 }
821 else
822 {
823 theService.setParamzip(Paramzip);
824 }
825
826 theService.setParambdate(Parambdate);
827 theService.setParamphone(Paramphone);
828
829 theLog.debug("serviceSqlCustcomerAdd: Call statement");
831 theService.executeCall();
832
833 }
834 catch (com.orindasoft.pub.CSException e)
835 {
836 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
837 theLog.error("serviceSqlCustcomerAdd Failed:");
838 theLog.error(e.getMessage());
839 throw (e2);
840 }
841 finally
842 {
843
844 if (alwaysReleaseResources)
845 {
846 releaseResources();
848 }
849
850 }
851 }
852
858@WebMethod
860public void serviceSqlCustomerDelete
861 (@WebParam(name="ParamParam1") String ParamParam1) throws DAOFactoryServiceException
862 {
863 try
864 {
865 theLog.debug("serviceSqlCustomerDelete Starting");
866
867 theLog.debug("serviceSqlCustomerDelete: Get instance of created class");
869 com.orindasoft.demo.generated.sql.CustomerDelete theService = getCustomerDeleteSqlDAO();
870
871 theService.setParamParam1(ParamParam1);
872
873 theLog.debug("serviceSqlCustomerDelete: Call statement");
875 theService.executeCall();
876
877 }
878 catch (com.orindasoft.pub.CSException e)
879 {
880 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
881 theLog.error("serviceSqlCustomerDelete Failed:");
882 theLog.error(e.getMessage());
883 throw (e2);
884 }
885 finally
886 {
887
888 if (alwaysReleaseResources)
889 {
890 releaseResources();
892 }
893
894 }
895 }
896
908@WebMethod
910public void serviceSqlCustomerUpdate
911 (@WebParam(name="Paramaddress") String Paramaddress
912 ,@WebParam(name="Paramcity") String Paramcity
913 ,@WebParam(name="Paramstate") String Paramstate
914 ,@WebParam(name="Paramzip") double Paramzip
915 ,@WebParam(name="Parambdate") java.util.Date Parambdate
916 ,@WebParam(name="Paramphone") String Paramphone
917 ,@WebParam(name="Paramname") String Paramname) throws DAOFactoryServiceException
918 {
919 try
920 {
921 theLog.debug("serviceSqlCustomerUpdate Starting");
922
923 theLog.debug("serviceSqlCustomerUpdate: Get instance of created class");
925 com.orindasoft.demo.generated.sql.CustomerUpdate theService = getCustomerUpdateSqlDAO();
926
927 theService.setParamaddress(Paramaddress);
928 theService.setParamcity(Paramcity);
929 theService.setParamstate(Paramstate);
930
931 if (minValueIsNULL && Paramzip == Double.MIN_VALUE)
932 {
933 theService.setParamzipToNull();
934 }
935 else
936 {
937 theService.setParamzip(Paramzip);
938 }
939
940 theService.setParambdate(Parambdate);
941 theService.setParamphone(Paramphone);
942 theService.setParamname(Paramname);
943
944 theLog.debug("serviceSqlCustomerUpdate: Call statement");
946 theService.executeCall();
947
948 }
949 catch (com.orindasoft.pub.CSException e)
950 {
951 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
952 theLog.error("serviceSqlCustomerUpdate Failed:");
953 theLog.error(e.getMessage());
954 throw (e2);
955 }
956 finally
957 {
958
959 if (alwaysReleaseResources)
960 {
961 releaseResources();
963 }
964
965 }
966 }
967
973@WebMethod
975public com.orindasoft.demo.generated.sql.GetFlightsCursorAttr[] serviceSqlGetFlights
976 (@WebParam(name="Paramcity") String Paramcity) throws DAOFactoryServiceException
977 {
978 try
979 {
980 theLog.debug("serviceSqlGetFlights Starting");
981
982 com.orindasoft.demo.generated.sql.GetFlightsCursorAttr[] serviceOutput;
984
985 theLog.debug("serviceSqlGetFlights: Get instance of created class");
987 com.orindasoft.demo.generated.sql.GetFlights theService = getGetFlightsSqlDAO();
988
989 theLog.debug("serviceSqlGetFlights: Set parameters");
991 theService.setParamcity(Paramcity);
992 theService.setParamcity(Paramcity);
993
994 theLog.debug("serviceSqlGetFlights: Call Query");
996 serviceOutput = (com.orindasoft.demo.generated.sql.GetFlightsCursorAttr[])com.orindasoft.demo.generated.sql.GetFlights.getArrayFromReadOnlyRowSet(theService.executeQuery(), theLog, true );
997
998 theLog.debug("serviceSqlGetFlights: Unload results");
000
001 theLog.debug("serviceSqlGetFlights Returning Data");
002 return(serviceOutput);
003 }
004 catch (com.orindasoft.pub.CSException e)
005 {
006 DAOFactoryServiceException e2 = new DAOFactoryServiceException(e.getMessage());
007 theLog.error("serviceSqlGetFlights Failed:");
008 theLog.error(e.getMessage());
009 throw (e2);
010 }
011 finally
012 {
013
014 if (alwaysReleaseResources)
015 {
016 releaseResources();
018 }
019
020 }
021 }
022
028protected byte[] loadFileIntoByteArray(java.io.File theFile) throws CSException
029 {
030 byte[] newArray = null;
031 try
032 {
033 if (theFile != null && theFile.exists() && theFile.length() > 0)
034 {
035 if (theFile.length() > Integer.MAX_VALUE)
036 {
037 throw new CSException("loadFileIntoByteArray: File "
038 + theFile.getAbsolutePath()
039 + " is too big to be turned into a Byte array");
040 }
041
042 theLog.debug("loadFileIntoByteArray: Starting to load "
043 + theFile.length()
044 + " from temp file " + theFile.getAbsolutePath() + " into byte array");
045
046 newArray = new byte[(int)theFile.length()];
047 java.io.BufferedInputStream theInputStream = new java.io.BufferedInputStream(new java.io.FileInputStream(theFile));
048 theInputStream.read(newArray);
049 theInputStream.close();
050 theLog.debug("loadFileIntoByteArray: Finished loading byte array");
051 }
052 else
053 {
054 theLog.debug("loadFileIntoByteArray: Turning empty/null file into byte array");
055 }
056
057 }
058 catch (java.io.IOException e)
059 {
060 throw new CSException("loadFileIntoByteArray:" + e.getMessage());
061 }
062
063 return (newArray);
064 }
065
066
067
074protected byte[] loadFileIntoByteArray(java.io.File theFile, byte[] theArray) throws CSException
075 {
076 if (theArray != null)
077 {
078 return(theArray);
079 }
080 return (loadFileIntoByteArray(theFile));
081 }
082
083
084
090protected java.io.File loadByteArrayIntoFile(byte[] theBytes) throws CSException
091 {
092 return(com.orindasoft.pub.IOUtils.loadByteArrayIntoFile(theBytes, tempFilePrefix, tempFileSuffix, tempFileDir.getAbsolutePath(), theLog));
093 }
094
095
101protected WsdlRowSet createWSDLRowset(com.orindasoft.pub.ReadOnlyRowSet theRowSet) throws CSException
102 {
103 WsdlRowSet newRowSet = new WsdlRowSet();
104
105 if (theRowSet == null)
106 {
107 return(newRowSet);
108 }
109
110 newRowSet.columnNames = theRowSet.getColumnNamesAsStringArray();
111 newRowSet.rows = new WsdlRow[theRowSet.size()];
112
113 for (int i=0; i < theRowSet.size(); i++)
114 {
115 try
116 {
117 theRowSet.setCurrentRowNumber(i);
118 newRowSet.rows[i] = new WsdlRow();
119 Object[] currentRow = theRowSet.getCurrentRow();
120 newRowSet.rows[i].rowColumns = new WsdlElement[currentRow.length];
121
122 for (int j=0; j < currentRow.length; j++)
123 {
124 newRowSet.rows[i].rowColumns[j] = new WsdlElement();
125 newRowSet.rows[i].rowColumns[j].column = currentRow[j];
126
127 if (newRowSet.rows[i].rowColumns[j].column instanceof java.io.File)
129 {
130 java.io.File tempFile = (java.io.File)newRowSet.rows[i].rowColumns[j].column;
131 if (tempFile.exists())
132 {
133 newRowSet.rows[i].rowColumns[j].column = loadFileIntoByteArray(tempFile);
134 tempFile.delete();
135 }
136 else
137 {
138 newRowSet.rows[i].rowColumns[j].column = new byte[0];
139 }
140 }
141 else if ( newRowSet.rows[i].rowColumns[j].column instanceof oracle.sql.INTERVALDS
144 || newRowSet.rows[i].rowColumns[j].column instanceof oracle.sql.INTERVALYM)
145 {
146 newRowSet.rows[i].rowColumns[j].column = newRowSet.rows[i].rowColumns[j].column.toString().trim();
147 }
148 else if ( newRowSet.rows[i].rowColumns[j].column instanceof oracle.sql.TIMESTAMP)
151 {
152 newRowSet.rows[i].rowColumns[j].column = oracle.sql.TIMESTAMP.toString(((oracle.sql.TIMESTAMP)newRowSet.rows[i].rowColumns[j].column).getBytes());
153 }
154 else if ( newRowSet.rows[i].rowColumns[j].column instanceof oracle.sql.TIMESTAMPTZ)
155 {
156 try
157 {
158 newRowSet.rows[i].rowColumns[j].column = oracle.sql.TIMESTAMPTZ.toString(theConnection,((oracle.sql.TIMESTAMPTZ)newRowSet.rows[i].rowColumns[j].column).getBytes());
159 }
160 catch (java.sql.SQLException e)
161 {
162 theLog.error("Row " + i + " Column " + newRowSet.columnNames[j] +": SQLException thrown:");
163 theLog.error(e);
164 throw new CSException(e.getMessage());
165 }
166 }
167 else if ( newRowSet.rows[i].rowColumns[j].column instanceof oracle.sql.TIMESTAMPLTZ)
168 {
169 try
170 {
171 newRowSet.rows[i].rowColumns[j].column = oracle.sql.TIMESTAMPLTZ.toString(theConnection,((oracle.sql.TIMESTAMPLTZ)newRowSet.rows[i].rowColumns[j].column).getBytes());
172 }
173 catch (java.sql.SQLException e)
174 {
175 theLog.error("Row " + i + " Column " + newRowSet.columnNames[j] +": SQLException thrown:");
176 theLog.error(e);
177 throw new CSException(e.getMessage());
178 }
179 }
180 else if (newRowSet.rows[i].rowColumns[j].column instanceof CSException)
182 {
183 theLog.error("Row " + i + " Column " + newRowSet.columnNames[j] +": CSException found instead of LOB.:");
184 theLog.error((CSException)newRowSet.rows[i].rowColumns[j].column);
185 throw((CSException)newRowSet.rows[i].rowColumns[j].column);
186 }
187
188 }
189 }
190 catch (com.orindasoft.pub.CSNoDataInRowSetException e)
191 {
192 newRowSet.rows[i] = null;
193 }
194 }
195 return(newRowSet);
196 }
197
198
202private void executeImmediate(String ddl, int allowableErrorCode) throws CSException
203 {
204 java.sql.CallableStatement theStatement = null;
205
206 if (theConnection == null)
207 {
208 throw (new CSException("Not Connected - Statement can not be issued"));
209 }
210
211 try
213 {
214 theLog.info(ddl);
215 theLog.debug("executeImmediate - Starting to parse statement");
216 theStatement = theConnection.prepareCall(ddl);
217 theLog.debug("executeImmediate - Finished parsing statement");
218 }
219 catch (java.sql.SQLException e)
220 {
221 theLog.error("executeImmediate: Prepare Statement failed with " + e.toString());
222 CSDBException e2 = new CSDBException(e.getErrorCode(),e.getMessage(),"executeImmediate","DAOFactory");
223 throw (e2);
224 }
225
226 try
227 {
228 theStatement.execute();
229 theStatement.close();
230 }
231 catch (java.sql.SQLException e)
232 {
233 if (e.getErrorCode() != allowableErrorCode)
234 {
235 theLog.error("DAOFactory - Execute Immediate Failed:");
236 theLog.error(e);
237 CSDBException e2 = new CSDBException(e.getErrorCode(),e.getMessage(),"executeImmediate","DAOFactory");
238 throw(e2);
239 }
240 }
241 }
242
243
248public void createExtraTypeObjects() throws CSException
249 {
250 confirmConnection("createExtraTypeObjects");
251
252 executeImmediate("CREATE OR REPLACE TYPE OSOFT46ND2_T AS OBJECT"
253
254 + " (COL_0 VARCHAR2(16)"
255
256 + " ,COL_1 VARCHAR2(64)"
257
258 + " ,COL_2 NUMBER"
259
260 + " ,COL_3 DATE"
261
262 + " ,COL_4 VARCHAR2(4))",SqlUtils.TYPE_HAS_DEPENDENTS);
263
264 executeImmediate("CREATE OR REPLACE TYPE OSOFT46ND2_A AS TABLE OF OSOFT46ND2_T;",SqlUtils.TYPE_HAS_DEPENDENTS);
265 executeImmediate("CREATE OR REPLACE TYPE OSOFT446NDD6_T AS OBJECT"
266
267 + " (COL_0 VARCHAR2(16)"
268
269 + " ,COL_1 VARCHAR2(16)"
270
271 + " ,COL_2 VARCHAR2(64)"
272
273 + " ,COL_3 NUMBER"
274
275 + " ,COL_4 DATE"
276
277 + " ,COL_5 DATE"
278
279 + " ,COL_6 VARCHAR2(64))",SqlUtils.TYPE_HAS_DEPENDENTS);
280
281 executeImmediate("CREATE OR REPLACE TYPE OSOFT446NDD6_A AS TABLE OF OSOFT446NDD6_T;",SqlUtils.TYPE_HAS_DEPENDENTS);
282
283 }
284
285
290public void dropExtraTypeObjects() throws CSException
291 {
292 confirmConnection("dropExtraTypeObjects");
293
294 executeImmediate("DROP TYPE OSOFT46ND2_A",SqlUtils.OBJECT_DOES_NOT_EXIST);
295
296 executeImmediate("DROP TYPE OSOFT46ND2_T",SqlUtils.OBJECT_DOES_NOT_EXIST);
297
298 executeImmediate("DROP TYPE OSOFT446NDD6_A",SqlUtils.OBJECT_DOES_NOT_EXIST);
299
300 executeImmediate("DROP TYPE OSOFT446NDD6_T",SqlUtils.OBJECT_DOES_NOT_EXIST);
301
302 }
303
304
309public void dropAllExtraTypeObjects() throws CSException
310 {
311
312 final String DROP_ALL_TYPES_BLOCK =
313 "DECLARE\n"
314 + "--\n"
315 + "CURSOR typecur IS\n"
316 + "SELECT 'DROP TYPE '||type_name cmd\n"
317 + "FROM user_types\n"
318 + "WHERE type_name LIKE '" + tempFilePrefix.toUpperCase() + "%'\n"
319 + "ORDER BY DECODE (typecode,'COLLECTION',1,2), type_name;\n"
320 + "--\n"
321 + "BEGIN\n"
322 + "--\n"
323 + "FOR typerec IN typecur LOOP\n"
324 + "--\n"
325 + " EXECUTE IMMEDIATE typerec.cmd;\n"
326 + "--\n"
327 + "END LOOP;\n"
328 + "--\n"
329 + "END;\n";
330
331 confirmConnection("dropAllExtraTypeObjects");
332 executeImmediate(DROP_ALL_TYPES_BLOCK,0);
333
334 }
335}