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
33 public class DAOFactoryServiceImpl extends DAOFactory implements OracleResourceUser, DAOFactoryServiceInterface
34 {
35
36
42 protected boolean alwaysReleaseResources = false;
43
44
48 public DAOFactoryServiceImpl()
49 {
50 super();
51 }
52
53
60 public DAOFactoryServiceImpl(java.sql.Connection theConnection, LogInterface theLog)
61 {
62 super(theConnection,theLog);
63 }
64
65
71 public DAOFactoryServiceImpl(LogInterface theLog)
72 {
73 super(theLog);
74 }
75
76
77
82 protected void setAlwaysReleaseResourcesFlag(boolean alwaysReleaseResources)
83 {
84 this.alwaysReleaseResources = alwaysReleaseResources;
85 }
86
87
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
112@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 boolean serviceOutput;
124
125 theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable: Get instance of created class");
127 com.orindasoft.demo.generated.plsql.CursorExampleDirectFlightAvailable theService = getCursorExampleDirectFlightAvailablePlSqlDAO();
128
129 theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable: Set parameters");
131 theService.setParamPFromcity(paramPFromcity);
132 theService.setParamPTocity(paramPTocity);
133
134 theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable: Call procedure");
136 theService.executeProc();
137
138 theLog.debug("servicePlsqlCursorExampleDirectFlightAvailable: Unload results");
140 serviceOutput = theService.getFunctionResultBoolean();
141
142 if (alwaysReleaseResources)
143 {
144 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
168@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 com.orindasoft.demo.generated.plsql.CursorExampleFlightsRefcursorTypeAttrs[] serviceOutput;
181
182 theLog.debug("servicePlsqlCursorExampleFindDirectFlights: Get instance of created class");
184 com.orindasoft.demo.generated.plsql.CursorExampleFindDirectFlights theService = getCursorExampleFindDirectFlightsPlSqlDAO();
185
186 theService.setUseByteArraysForLongsAndLOBS(true);
188
189 theLog.debug("servicePlsqlCursorExampleFindDirectFlights: Set parameters");
191 theService.setParamPFromcity(paramPFromcity);
192 theService.setParamPTocity(paramPTocity);
193 theService.setParamPOrderby(paramPOrderby);
194
195 theLog.debug("servicePlsqlCursorExampleFindDirectFlights: Call procedure");
197 theService.executeProc();
198
199 theLog.debug("servicePlsqlCursorExampleFindDirectFlights: Unload results");
201 serviceOutput = (CursorExampleFlightsRefcursorTypeAttrs[])CursorExampleFlightsRefcursorType.createCursorExampleFlightsRefcursorTypeArrayFromRowSet(theService.getParamPFlightlist(),theLog);
202
203 if (alwaysReleaseResources)
204 {
205 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
226@WebMethod
228public com.orindasoft.demo.generated.plsql.CursorExampleGetlistsReturn servicePlsqlCursorExampleGetlists() throws DAOFactoryServiceException
229 {
230 try
231 {
232 theLog.debug("servicePlsqlCursorExampleGetlists Starting");
233
234 com.orindasoft.demo.generated.plsql.CursorExampleGetlistsReturn serviceOutput = new com.orindasoft.demo.generated.plsql.CursorExampleGetlistsReturn();
236
237 theLog.debug("servicePlsqlCursorExampleGetlists: Get instance of created class");
239 com.orindasoft.demo.generated.plsql.CursorExampleGetlists theService = getCursorExampleGetlistsPlSqlDAO();
240
241 theService.setUseByteArraysForLongsAndLOBS(true);
243
244 theLog.debug("servicePlsqlCursorExampleGetlists: Set parameters");
246
247 theLog.debug("servicePlsqlCursorExampleGetlists: Call procedure");
249 theService.executeProc();
250
251 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 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
282@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 String serviceOutput;
294
295 theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray: Get instance of created class");
297 com.orindasoft.demo.generated.plsql.ObjectArrayExampleAddBookingsObjectArray theService = getObjectArrayExampleAddBookingsObjectArrayPlSqlDAO();
298
299 theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray: Set parameters");
301 theService.setParamPCustomer(Customers.createCustomersFromCustomersAttrs(paramPCustomer));
302 theService.setParamPBookingTable(new BookingsTable(theLog, (BookingsType.createBookingsTypeArrayFromBookingsTypeAttrsArray(paramPBookingTable))));
303
304 theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray: Call procedure");
306 theService.executeProc();
307
308 theLog.debug("servicePlsqlObjectArrayExampleAddBookingsObjectArray: Unload results");
310 serviceOutput = theService.getParamPStatusMessage();
311
312 if (alwaysReleaseResources)
313 {
314 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
336@WebMethod
338public FlightsTypeAttrs[] servicePlsqlObjectArrayExampleGetObjectArrayOfFlights
339 (@WebParam(name="paramPCity") String paramPCity) throws DAOFactoryServiceException
340 {
341 try
342 {
343 theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights Starting");
344
345 FlightsTypeAttrs[] serviceOutput;
347
348 theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights: Get instance of created class");
350 com.orindasoft.demo.generated.plsql.ObjectArrayExampleGetObjectArrayOfFlights theService = getObjectArrayExampleGetObjectArrayOfFlightsPlSqlDAO();
351
352 theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights: Set parameters");
354 theService.setParamPCity(paramPCity);
355
356 theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights: Call procedure");
358 theService.executeProc();
359
360 theLog.debug("servicePlsqlObjectArrayExampleGetObjectArrayOfFlights: Unload results");
362 serviceOutput = theService.getParamPFlightsFrom().getCurrentValues();
363
364 if (alwaysReleaseResources)
365 {
366 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
389@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 String serviceOutput;
401
402 theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray: Get instance of created class");
404 com.orindasoft.demo.generated.plsql.PackageArrayExampleAddBookingsPlsqlArray theService = getPackageArrayExampleAddBookingsPlsqlArrayPlSqlDAO();
405
406 theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray: Set parameters");
408 theService.setParamPCustomer(Customers.createCustomersFromCustomersAttrs(paramPCustomer));
409 theService.setParamPBookingTable(new PackageArrayExampleBookingsPlsqlArray(theLog, (Bookings.createBookingsArrayFromBookingsAttrsArray(paramPBookingTable))));
410
411 theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray: Call procedure");
413 theService.executeProc();
414
415 theLog.debug("servicePlsqlPackageArrayExampleAddBookingsPlsqlArray: Unload results");
417 serviceOutput = theService.getParamPStatusMessage();
418
419 if (alwaysReleaseResources)
420 {
421 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
443@WebMethod
445public FlightsAttrs[] servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights
446 (@WebParam(name="paramPCity") String paramPCity) throws DAOFactoryServiceException
447 {
448 try
449 {
450 theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights Starting");
451
452 FlightsAttrs[] serviceOutput;
454
455 theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights: Get instance of created class");
457 com.orindasoft.demo.generated.plsql.PackageArrayExampleGetPlsqlArrayOfFlights theService = getPackageArrayExampleGetPlsqlArrayOfFlightsPlSqlDAO();
458
459 theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights: Set parameters");
461 theService.setParamPCity(paramPCity);
462
463 theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights: Call procedure");
465 theService.executeProc();
466
467 theLog.debug("servicePlsqlPackageArrayExampleGetPlsqlArrayOfFlights: Unload results");
469 serviceOutput = theService.getParamPFlightsFrom().getCurrentValues();
470
471 if (alwaysReleaseResources)
472 {
473 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
496@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 String serviceOutput;
508
509 theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray: Get instance of created class");
511 com.orindasoft.demo.generated.plsql.PackageIdxarrayExampleAddBookingsPlsqlArray theService = getPackageIdxarrayExampleAddBookingsPlsqlArrayPlSqlDAO();
512
513 theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray: Set parameters");
515 theService.setParamPCustomer(Customers.createCustomersFromCustomersAttrs(paramPCustomer));
516 theService.setParamPBookingTable(new PackageIdxarrayExampleBookingsPlsqlArray(theLog, (Bookings.createBookingsArrayFromBookingsAttrsArray(paramPBookingTable))));
517
518 theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray: Call procedure");
520 theService.executeProc();
521
522 theLog.debug("servicePlsqlPackageIdxarrayExampleAddBookingsPlsqlArray: Unload results");
524 serviceOutput = theService.getParamPStatusMessage();
525
526 if (alwaysReleaseResources)
527 {
528 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
550@WebMethod
552public FlightsAttrs[] servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights
553 (@WebParam(name="paramPCity") String paramPCity) throws DAOFactoryServiceException
554 {
555 try
556 {
557 theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights Starting");
558
559 FlightsAttrs[] serviceOutput;
561
562 theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights: Get instance of created class");
564 com.orindasoft.demo.generated.plsql.PackageIdxarrayExampleGetPlsqlArrayOfFlights theService = getPackageIdxarrayExampleGetPlsqlArrayOfFlightsPlSqlDAO();
565
566 theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights: Set parameters");
568 theService.setParamPCity(paramPCity);
569
570 theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights: Call procedure");
572 theService.executeProc();
573
574 theLog.debug("servicePlsqlPackageIdxarrayExampleGetPlsqlArrayOfFlights: Unload results");
576 serviceOutput = theService.getParamPFlightsFrom().getCurrentValues();
577
578 if (alwaysReleaseResources)
579 {
580 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
601@WebMethod
603public void serviceSqlChangeFlightDates() throws DAOFactoryServiceException
604 {
605 try
606 {
607 theLog.debug("serviceSqlChangeFlightDates Starting");
608
609 theLog.debug("serviceSqlChangeFlightDates: Get instance of created class");
611 com.orindasoft.demo.generated.sql.ChangeFlightDates theService = getChangeFlightDatesSqlDAO();
612
613
614 theLog.debug("serviceSqlChangeFlightDates: Call statement");
616 theService.executeCall();
617
618
619 if (alwaysReleaseResources)
620 {
621 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
646@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 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 theLog.debug("serviceSqlCustcomerAdd: Call statement");
675 theService.executeCall();
676
677
678 if (alwaysReleaseResources)
679 {
680 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
699@WebMethod
701public void serviceSqlCustomerDelete
702 (@WebParam(name="ParamParam1") String ParamParam1) throws DAOFactoryServiceException
703 {
704 try
705 {
706 theLog.debug("serviceSqlCustomerDelete Starting");
707
708 theLog.debug("serviceSqlCustomerDelete: Get instance of created class");
710 com.orindasoft.demo.generated.sql.CustomerDelete theService = getCustomerDeleteSqlDAO();
711
712 theService.setParamParam1(ParamParam1);
713
714 theLog.debug("serviceSqlCustomerDelete: Call statement");
716 theService.executeCall();
717
718
719 if (alwaysReleaseResources)
720 {
721 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
746@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 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 theLog.debug("serviceSqlCustomerUpdate: Call statement");
775 theService.executeCall();
776
777
778 if (alwaysReleaseResources)
779 {
780 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
799@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 com.orindasoft.demo.generated.sql.GetFlightsCursorAttr[] serviceOutput;
810
811 theLog.debug("serviceSqlGetFlights: Get instance of created class");
813 com.orindasoft.demo.generated.sql.GetFlights theService = getGetFlightsSqlDAO();
814
815 theLog.debug("serviceSqlGetFlights: Set parameters");
817 theService.setParamcity(Paramcity);
818 theService.setParamcity(Paramcity);
819
820 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 theLog.debug("serviceSqlGetFlights: Unload results");
826
827 if (alwaysReleaseResources)
828 {
829 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
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
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
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
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 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 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 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 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
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 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
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
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
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}