1  package com.orindasoft.demo.generated;
2  
3  
4  import java.sql.Connection; 
5  import com.orindasoft.pub.LogInterface; 
6  import com.orindasoft.pub.OracleResourceUser; 
7  import com.orindasoft.pub.CSException; 
8  import com.orindasoft.pub.CSDBException; 
9  
10 // From oracle 9.0.1 "oracle.jdbc.driver" is deprecated and 
11 // its contents move to "oracle.jdbc". "oracle.jdbc.driver" 
12 // still exists in 9.2.0.
13 import oracle.jdbc.OracleConnection;
14 // import oracle.jdbc.driver.OracleConnection;
15 
16 /** 
17 * DAO Factory class used by classes generated by JDBCWizard./a>
18 * 
19 * <p>Generated by JDBCWizard./a> build 2776 at 2011/03/07 19:55:48.159 GMT
20 * <p>JDBCWizard./a> is made by Orinda Software Ltd, Dublin, Ireland
21 * <p>Target Database: Oracle 10.2.0
22 * <p> -------------------------------------------------------------------------
23 * <p> WARNING: This code will stop working around the time JDBCWizard./a> expires.
24 * <p> This restriction only exists in the demo version of JDBCWizard./a>.
25 * <p> -------------------------------------------------------------------------
26 * <p> JDBCWizard./a> Tips 5 of 19:
27 * <p> JDBCWizard./a> can run stored procedures with Oracle TYPE and %ROWTYPE parameters
28 * <p> -------------------------------------------------------------------------
29 * 
30 * <p>Copyright Orinda Software 2003-2009
31 * @author devteam60@orindabuild.com
32 * @version 1.1
33 */ 
34 public class DAOFactory implements OracleResourceUser
35 { 
36   /** 
37   * Value used for array fetches. 
38   */ 
39   private int arrayFetchSize = 50; 
40   
41   /** 
42   * Value used for batch updates 
43   */ 
44   private int batchUpdateSize = 1; 
45   
46   /** 
47   * Database Connection 
48   */ 
49   public Connection theConnection = null; 
50   
51   /** 
52   * An instance of a class which implements com.orindasoft.pub.LogInterface 
53   */ 
54   public com.orindasoft.pub.LogInterface theLog = null; 
55   
56   /**
57   * Flag that controls whether we commit when releasing connections
58   * @see <a href=http://www.orindasoft.com/public/Running%20GUItwo.php4#fouor&pdsrc=GD2776 TARGET=_blank class=news>Altering the behaviour of generated code</a>
59   * @since JDBCWizard./a> 4.0.2098
60   */
61   protected boolean commitOnRelease = true;
62   
63   /**
64   * Flag that controls whether we close the connection when releaseConnection is called
65   * @see <a href=http://www.orindasoft.com/public/Running%20GUItwo.php4#fouor&pdsrc=GD2776 TARGET=_blank class=news>Altering the behaviour of generated code</a>
66   * @since JDBCWizard./a> 4.0.2107
67   * @since JDBCWizard./a> 4.0.2145 Default value is now controlled by UI
68   */
69   protected boolean closeOnRelease = true;
70   
71   /**
72   * String that if non-null should contain a valid Oracle time zone name.
73   * This is used for working with oracle.sql.TIMESTAMPLTZ, which needs  
74   * an OracleConnection that has been made time zone aware in order to work.
75   * A list of valid time zones is stored in V$TIMEZONE_NAMES and the timezone
76   * is set by calling the method setSessionTimeZone(). If the timezone is not
77   * set and an attempt is made to use TIMESTAMPLTZ the 
78   * java.sql.SQLException "connection session time zone was not set" will be thrown
79   * @see oracle.sql.OracleConnection.setSessionTimeZone()
80   * @see confirmConnection()
81   * @see setOracleTimeZoneName
82   * @since JDBCWizard./a> 4.0.2145
83   * @since Oracle V9.0.1
84   */
85   protected String oracleTimeZoneName = null;
86   
87   /**
88   * Buffer Size for downloading files from the DB.
89   * @since JDBCWizard./a> 4.0.2043
90   * @since JDBCWizard./a> 4.0.2145 Default value is now controlled by UI
91   */
92   protected int bufferSize = 4096;
93   
94   /**
95   * Temporary directory for downloaded files.
96   * @since 4.0.2043
97   */
98   protected java.io.File tempFileDir = new java.io.File (System.getProperty("user.dir"));
99   
100  /**
101  * boolean flag that controls whether LOBs are turned into byte[]
102  * @since 5.0.2314
103  */
104  protected boolean useByteArraysForLongsAndLOBS = true;
105  
106  /**
107  * Variable to store boolean flag that indicates whether created files should be deleted when the JVM exits.
108  */
109  protected boolean keepFiles = true;
110  
111  /**
112  * boolean flag that specifies whether lobs such as CLOBS, BLOBS and BFILES
113  * will be kept as Oracle objects or downloaded into Files.
114  * @since 4.0.2100
115  */
116  protected boolean keepLobs = false;
117  
118  /**
119  * Prefix for downloaded files containing BLOB, CLOB and BFILE data
120  * @since 4.0.2043
121  * @since 4.0.2139 The default value for this is now set in the UI
122  */
123  protected String tempFilePrefix = "OSOFT";
124  
125  /**
126  * Suffix for downloaded files containing BLOB, CLOB and BFILE data
127  * @since 4.0.2043
128  * @since 4.0.2139 The default value for this is now set in the UI
129  */
130  protected String tempFileSuffix = ".tmp";
131  
132  /**
133  * long object loader for BLOB, CLOB and BFILE data.
134  * This variable is only instantiated if needed.
135  * @since 4.0.2108
136  */
137  protected com.orindasoft.pub.LongObjectLoader lobLoader = null;
138  
139  /** 
140  * Default value for implict SQL statement cache size
141  * To turn off the implicit SQL statement cache set this to 0.
142  * The initial value is based on the number of SQL statements this service uses.
143  * To accept default cache sizes provided by a DataSource set this to -1 
144  * @since 5.0.2496 
145  */
146  protected int implicitSqlCacheSize = 54;
147  
148  /** 
149  * Callable Statment for batch commit
150  * @since 5.0.2496 
151  */ 
152  protected java.sql.CallableStatement batchCommitStatement = null; 
153  
154  /** 
155  * Instance of Class CursorExampleDirectFlightAvailable - Access PL/SQL CURSOR_EXAMPLE.DIRECT_FLIGHT_AVAILABLE
156  */ 
157  protected com.orindasoft.demo.generated.plsql.CursorExampleDirectFlightAvailable theCursorExampleDirectFlightAvailable = null;
158  
159  /** 
160  * Instance of Class CursorExampleFindDirectFlights - Access PL/SQL CURSOR_EXAMPLE.FIND_DIRECT_FLIGHTS
161  */ 
162  protected com.orindasoft.demo.generated.plsql.CursorExampleFindDirectFlights theCursorExampleFindDirectFlights = null;
163  
164  /** 
165  * Instance of Class CursorExampleGetlists - Access PL/SQL CURSOR_EXAMPLE.GETLISTS
166  */ 
167  protected com.orindasoft.demo.generated.plsql.CursorExampleGetlists theCursorExampleGetlists = null;
168  
169  /** 
170  * Instance of Class ObjectArrayExampleAddBookingsObjectArray - Access PL/SQL OBJECT_ARRAY_EXAMPLE.ADD_BOOKINGS_OBJECT_ARRAY
171  */ 
172  protected com.orindasoft.demo.generated.plsql.ObjectArrayExampleAddBookingsObjectArray theObjectArrayExampleAddBookingsObjectArray = null;
173  
174  /** 
175  * Instance of Class ObjectArrayExampleGetObjectArrayOfFlights - Access PL/SQL OBJECT_ARRAY_EXAMPLE.GET_OBJECT_ARRAY_OF_FLIGHTS
176  */ 
177  protected com.orindasoft.demo.generated.plsql.ObjectArrayExampleGetObjectArrayOfFlights theObjectArrayExampleGetObjectArrayOfFlights = null;
178  
179  /** 
180  * Instance of Class PackageArrayExampleAddBookingsPlsqlArray - Access PL/SQL PACKAGE_ARRAY_EXAMPLE.ADD_BOOKINGS_PLSQL_ARRAY
181  */ 
182  protected com.orindasoft.demo.generated.plsql.PackageArrayExampleAddBookingsPlsqlArray thePackageArrayExampleAddBookingsPlsqlArray = null;
183  
184  /** 
185  * Instance of Class PackageArrayExampleGetPlsqlArrayOfFlights - Access PL/SQL PACKAGE_ARRAY_EXAMPLE.GET_PLSQL_ARRAY_OF_FLIGHTS
186  */ 
187  protected com.orindasoft.demo.generated.plsql.PackageArrayExampleGetPlsqlArrayOfFlights thePackageArrayExampleGetPlsqlArrayOfFlights = null;
188  
189  /** 
190  * Instance of Class PackageIdxarrayExampleAddBookingsPlsqlArray - Access PL/SQL PACKAGE_IDXARRAY_EXAMPLE.ADD_BOOKINGS_PLSQL_ARRAY
191  */ 
192  protected com.orindasoft.demo.generated.plsql.PackageIdxarrayExampleAddBookingsPlsqlArray thePackageIdxarrayExampleAddBookingsPlsqlArray = null;
193  
194  /** 
195  * Instance of Class PackageIdxarrayExampleGetPlsqlArrayOfFlights - Access PL/SQL PACKAGE_IDXARRAY_EXAMPLE.GET_PLSQL_ARRAY_OF_FLIGHTS
196  */ 
197  protected com.orindasoft.demo.generated.plsql.PackageIdxarrayExampleGetPlsqlArrayOfFlights thePackageIdxarrayExampleGetPlsqlArrayOfFlights = null;
198  
199  /** 
200  * Instance of Class AircraftMgr - Access Table AIRCRAFT
201  */ 
202  protected com.orindasoft.demo.generated.table.manager.AircraftMgr TheAircraftMgr = null;
203  
204  /** 
205  * Instance of Class AirlinesMgr - Access Table AIRLINES
206  */ 
207  protected com.orindasoft.demo.generated.table.manager.AirlinesMgr TheAirlinesMgr = null;
208  
209  /** 
210  * Instance of Class AirportsMgr - Access Table AIRPORTS
211  */ 
212  protected com.orindasoft.demo.generated.table.manager.AirportsMgr TheAirportsMgr = null;
213  
214  /** 
215  * Instance of Class BookingsMgr - Access Table BOOKINGS
216  */ 
217  protected com.orindasoft.demo.generated.table.manager.BookingsMgr TheBookingsMgr = null;
218  
219  /** 
220  * Instance of Class CustomersMgr - Access Table CUSTOMERS
221  */ 
222  protected com.orindasoft.demo.generated.table.manager.CustomersMgr TheCustomersMgr = null;
223  
224  /** 
225  * Instance of Class FlightsMgr - Access Table FLIGHTS
226  */ 
227  protected com.orindasoft.demo.generated.table.manager.FlightsMgr TheFlightsMgr = null;
228  
229  /** 
230  * Instance of Class SequentialNumberGenerator - Access Sequence SEQUENTIAL_NUMBER_GENERATOR
231  */ 
232  protected com.orindasoft.demo.generated.sequence.SequentialNumberGenerator theSequentialNumberGenerator = null;
233  
234  /** 
235  * Instance of Class ChangeFlightDates
236  */ 
237  protected com.orindasoft.demo.generated.sql.ChangeFlightDates theChangeFlightDates = null;
238  
239  /** 
240  * Instance of Class CustcomerAdd
241  */ 
242  protected com.orindasoft.demo.generated.sql.CustcomerAdd theCustcomerAdd = null;
243  
244  /** 
245  * Instance of Class CustomerDelete
246  */ 
247  protected com.orindasoft.demo.generated.sql.CustomerDelete theCustomerDelete = null;
248  
249  /** 
250  * Instance of Class CustomerUpdate
251  */ 
252  protected com.orindasoft.demo.generated.sql.CustomerUpdate theCustomerUpdate = null;
253  
254  /** 
255  * Instance of Class GetFlights
256  */ 
257  protected com.orindasoft.demo.generated.sql.GetFlights theGetFlights = null;
258  
259   
260  /** 
261  * Default constructor for DAOFactory using Text Log
262  * The logging mechanism is chosen in step 4.3.
263  * <p>
264  * Connecting to the database is handled by confirmConnection() when a request for
265  * a DAO is received.
266  * <p>
267  * Messages will appear in one or more log files whose names 
268  * start with 'DAOFactory'.  
269  * <p>
270  * In addition to normal directory names this Log class also accepts 
271  * 'user.home' and 'user.dir', and will assume they are valid System properties. 
272  * <p>
273  * In this case the files will be found in the directory returned by System.getProperies("user.home") 
274  * @see com.orindasoft.demo.generated.DAOFactory#confirmConnection()
275  */                                   
276  public DAOFactory() 
277    {                                                 
278    theLog = new com.orindasoft.pub.TextLog("user.home","DAOFactory");
279    // Stop debug messages from being ignored by logger
280    theLog.debugOn();
281    // Make sure log is flushed every statement as we are in debug mode
282    theLog.setAutoFlush(true);
283    theLog.debug("DAOFactory - Started");
284    }                                                  
285                                                      
286  /** 
287  * Create an instance of DAOFactory using a database connection and an instance of LogInterface 
288  *  @param Connection theConnection A database connection 
289  *  @param LogInterface theLog An instance of a class that implements com.orindasoft.pub.LogInterface 
290  */ 
291  public DAOFactory(Connection theConnection, LogInterface theLog) 
292    { 
293    this.theConnection = theConnection; 
294    this.theLog = theLog; 
295    theLog.debug("DAOFactory - Started with Connection and LogInterface");
296    } 
297   
298  /** 
299  * Create an instance of DAOFactory using an instance of LogInterface  
300  *  @param LogInterface theLog An instance of a class that implements com.orindasoft.pub.LogInterface  
301  */                                   
302  public DAOFactory(LogInterface theLog)      
303    {                                                 
304    this.theLog = theLog;                             
305    theLog.debug("DAOFactory - Started with LogInterface");
306    }                                                  
307     
308  /** 
309  * Prepare batch commit statement
310  * @since 5.0.2496 
311  */ 
312  protected java.sql.CallableStatement prepareBatchCommitStatement() throws CSDBException     
313    {                                                                   
314    java.sql.CallableStatement newStatement = null;                                      
315                                                                     
316    // Parse batch commit request...                          
317    try                                                              
318      {                                                                
319      theLog.debug("prepareBatchCommitStatement - Starting to parse statement");
320      newStatement = theConnection.prepareCall("BEGIN COMMIT WRITE BATCH NOWAIT; END;");    
321      theLog.debug("prepareBatchCommitStatement - Finished parsing statement");
322      }                                                                  
323    catch (java.sql.SQLException e)                                    
324      {                                                                   
325      theLog.error("prepareBatchCommitStatement: Prepare Statement failed with " + e.toString());
326      CSDBException e2 = new CSDBException(e.getErrorCode(),e.getMessage(),"commit batch","DAOFactory");
327      throw (e2);   
328      }       
329              
330    return(newStatement);  
331                        
332    }                      
333                         
334  /**                                                        
335  * Commit changes to the database without waiting for confirmation from the redo log.    
336  * This method uses the asyncrhornous commit functionality of Oracle 10.2 and higher. 
337  * A normal commit waits for a response indicating that changes made by the transaction  
338  * are safely stored in the redo log. This form of commit assumes they will be stored, but 
339  * if the database crashes within a few seconds of the call transactions that were 'committed' 
340  * with this call may be lost. The plus side is that because uses asynchronous IO it's up to  
341  * 100 times faster than a normal commit.  
342  *   
343  * WARNING: Do not use this method if you do not understand and accept the possibility  of data loss. 
344  *   
345  * @throws CSDBException if something goes wrong. This is most likely to 
346  * if <code>batchUpdateSize</code> is a value other than 1. 
347  */                                                         
348  public void commitWriteBatchNowait() throws CSDBException      
349    {                                  
350     
351    if (theConnection != null)
352      {                                  
353      try
354        {
355        theLog.debug("DAOFactory - Committing Changes");
356                                                                                
357        if (batchCommitStatement == null)                                              
358          {      
359          // Parse batch commit statement    
360          batchCommitStatement = prepareBatchCommitStatement();
361          }    
362              
363        batchCommitStatement.execute();
364        }
365      catch (java.sql.SQLException e)
366        {
367        theLog.error("DAOFactory - Batch Commit Failed:");
368        theLog.error(e);
369        CSDBException e2 = new CSDBException(e.getErrorCode(),e.getMessage(),"commit","DAOFactory");
370        throw(e2);
371        }
372      }                            
373    }                            
374   
375  
376  /**
377  * Set String that if non-null should contain a valid Oracle time zone name.
378  * This is used for working with oracle.sql.TIMESTAMPLTZ, which needs 
379  * an OracleConnection that has been made time zone aware in order to work.
380  * A list of valid time zones is stored in V$TIMEZONE_NAMES. 
381  * @see oracle.sql.OracleConnection.setSessionTimeZone()
382  * @see confirmConnection()
383  * @since JDBCWizard./a> 4.0.2145
384  * @since Oracle V9.0.1
385  */
386  public void setOracleTimeZoneName(String oracleTimeZoneName)   
387    {                                  
388    this.oracleTimeZoneName = oracleTimeZoneName;      
389    }                                  
390  /** 
391  * Change value for implict SQL statement cache size
392  * A value of zero turns off the implicit SQL statement cache.
393  */
394  public  void setImplicitSqlCacheSize(int newSqlCacheSize)
395    {                                  
396    implicitSqlCacheSize = newSqlCacheSize;      
397    }                                  
398   
399  /** 
400  * Return value for implict SQL statement cache size
401  */
402  public int  getImplicitSqlCacheSize()
403    {                                  
404    return(implicitSqlCacheSize);      
405    }                                  
406   
407  
408   
409  /**  
410  * Set or reset the database connection and update all 
411  * the classes that are using it.
412  * @param Connection newConnection A database connection  
413  */       
414  public void setConnection(Connection newConnection)  
415    {                                               
416    theConnection = newConnection;          
417    theLog.debug("DAOFactory - Connection Set");
418    
419    // Change size of implicit connection cache if needed
420    if (theConnection instanceof OracleConnection)
421      {
422      if (implicitSqlCacheSize > -1)
423        {
424        try
425          {
426          if (implicitSqlCacheSize == 0)
427            {
428            if (((OracleConnection)newConnection).getImplicitCachingEnabled())  
429              {
430              theLog.debug("DAOFactory - disabling implicit statement cache" );
431              ((OracleConnection)theConnection).setImplicitCachingEnabled(false);
432              }
433            }
434          else 
435            {
436            if ( ! ((OracleConnection)newConnection).getImplicitCachingEnabled())  
437              {
438              theLog.debug("DAOFactory - enabling implicit statement cache" );
439              ((OracleConnection)theConnection).setImplicitCachingEnabled(true);
440              }
441             
442            if (((OracleConnection)theConnection).getStatementCacheSize()!= implicitSqlCacheSize)  
443              {
444              theLog.debug("DAOFactory - setting implicit connection cache size to " + implicitSqlCacheSize );
445              ((OracleConnection)theConnection).setStatementCacheSize(implicitSqlCacheSize);
446              }
447             
448            }
449          }
450        catch (Exception e)
451          {
452          theLog.error("setConnection: error while setting implicit connection cache");
453          theLog.error(e);
454          }
455        }
456      }
457    
458    // Tell CURSOR_EXAMPLE.DIRECT_FLIGHT_AVAILABLE about new Connection
459    if (theCursorExampleDirectFlightAvailable != null)
460      {                                               
461      theLog.debug("DAOFactory - Update CURSOR_EXAMPLE.DIRECT_FLIGHT_AVAILABLE DAO with new connection");
462      theCursorExampleDirectFlightAvailable.setConnection(theConnection);
463      }                                           
464      
465    // Tell CURSOR_EXAMPLE.FIND_DIRECT_FLIGHTS about new Connection
466    if (theCursorExampleFindDirectFlights != null)
467      {                                               
468      theLog.debug("DAOFactory - Update CURSOR_EXAMPLE.FIND_DIRECT_FLIGHTS DAO with new connection");
469      theCursorExampleFindDirectFlights.setConnection(theConnection);
470      }                                           
471      
472    // Tell CURSOR_EXAMPLE.GETLISTS about new Connection
473    if (theCursorExampleGetlists != null)
474      {                                               
475      theLog.debug("DAOFactory - Update CURSOR_EXAMPLE.GETLISTS DAO with new connection");
476      theCursorExampleGetlists.setConnection(theConnection);
477      }                                           
478      
479    // Tell OBJECT_ARRAY_EXAMPLE.ADD_BOOKINGS_OBJECT_ARRAY about new Connection
480    if (theObjectArrayExampleAddBookingsObjectArray != null)
481      {                                               
482      theLog.debug("DAOFactory - Update OBJECT_ARRAY_EXAMPLE.ADD_BOOKINGS_OBJECT_ARRAY DAO with new connection");
483      theObjectArrayExampleAddBookingsObjectArray.setConnection(theConnection);
484      }                                           
485      
486    // Tell OBJECT_ARRAY_EXAMPLE.GET_OBJECT_ARRAY_OF_FLIGHTS about new Connection
487    if (theObjectArrayExampleGetObjectArrayOfFlights != null)
488      {                                               
489      theLog.debug("DAOFactory - Update OBJECT_ARRAY_EXAMPLE.GET_OBJECT_ARRAY_OF_FLIGHTS DAO with new connection");
490      theObjectArrayExampleGetObjectArrayOfFlights.setConnection(theConnection);
491      }                                           
492      
493    // Tell PACKAGE_ARRAY_EXAMPLE.ADD_BOOKINGS_PLSQL_ARRAY about new Connection
494    if (thePackageArrayExampleAddBookingsPlsqlArray != null)
495      {                                               
496      theLog.debug("DAOFactory - Update PACKAGE_ARRAY_EXAMPLE.ADD_BOOKINGS_PLSQL_ARRAY DAO with new connection");
497      thePackageArrayExampleAddBookingsPlsqlArray.setConnection(theConnection);
498      }                                           
499      
500    // Tell PACKAGE_ARRAY_EXAMPLE.GET_PLSQL_ARRAY_OF_FLIGHTS about new Connection
501    if (thePackageArrayExampleGetPlsqlArrayOfFlights != null)
502      {                                               
503      theLog.debug("DAOFactory - Update PACKAGE_ARRAY_EXAMPLE.GET_PLSQL_ARRAY_OF_FLIGHTS DAO with new connection");
504      thePackageArrayExampleGetPlsqlArrayOfFlights.setConnection(theConnection);
505      }                                           
506      
507    // Tell PACKAGE_IDXARRAY_EXAMPLE.ADD_BOOKINGS_PLSQL_ARRAY about new Connection
508    if (thePackageIdxarrayExampleAddBookingsPlsqlArray != null)
509      {                                               
510      theLog.debug("DAOFactory - Update PACKAGE_IDXARRAY_EXAMPLE.ADD_BOOKINGS_PLSQL_ARRAY DAO with new connection");
511      thePackageIdxarrayExampleAddBookingsPlsqlArray.setConnection(theConnection);
512      }                                           
513      
514    // Tell PACKAGE_IDXARRAY_EXAMPLE.GET_PLSQL_ARRAY_OF_FLIGHTS about new Connection
515    if (thePackageIdxarrayExampleGetPlsqlArrayOfFlights != null)
516      {                                               
517      theLog.debug("DAOFactory - Update PACKAGE_IDXARRAY_EXAMPLE.GET_PLSQL_ARRAY_OF_FLIGHTS DAO with new connection");
518      thePackageIdxarrayExampleGetPlsqlArrayOfFlights.setConnection(theConnection);
519      }                                           
520      
521    // Tell AircraftMgr about new Connection
522    if (TheAircraftMgr != null)
523      {                                               
524      theLog.debug("DAOFactory - Update AircraftMgr DAO with new connection");
525      TheAircraftMgr.setConnection(theConnection);
526      }                                           
527      
528    // Tell AirlinesMgr about new Connection
529    if (TheAirlinesMgr != null)
530      {                                               
531      theLog.debug("DAOFactory - Update AirlinesMgr DAO with new connection");
532      TheAirlinesMgr.setConnection(theConnection);
533      }                                           
534      
535    // Tell AirportsMgr about new Connection
536    if (TheAirportsMgr != null)
537      {                                               
538      theLog.debug("DAOFactory - Update AirportsMgr DAO with new connection");
539      TheAirportsMgr.setConnection(theConnection);
540      }                                           
541      
542    // Tell BookingsMgr about new Connection
543    if (TheBookingsMgr != null)
544      {                                               
545      theLog.debug("DAOFactory - Update BookingsMgr DAO with new connection");
546      TheBookingsMgr.setConnection(theConnection);
547      }                                           
548      
549    // Tell CustomersMgr about new Connection
550    if (TheCustomersMgr != null)
551      {                                               
552      theLog.debug("DAOFactory - Update CustomersMgr DAO with new connection");
553      TheCustomersMgr.setConnection(theConnection);
554      }                                           
555      
556    // Tell FlightsMgr about new Connection
557    if (TheFlightsMgr != null)
558      {                                               
559      theLog.debug("DAOFactory - Update FlightsMgr DAO with new connection");
560      TheFlightsMgr.setConnection(theConnection);
561      }                                           
562      
563    // Tell SEQUENTIAL_NUMBER_GENERATOR about new Connection
564    if (theSequentialNumberGenerator != null)
565      {                                               
566      theLog.debug("DAOFactory - Update SEQUENTIAL_NUMBER_GENERATOR DAO with new connection");
567      theSequentialNumberGenerator.setConnection(theConnection);
568      }                                           
569      
570    // Tell ChangeFlightDates about new Connection
571    if (theChangeFlightDates != null)
572      {                                               
573      theLog.debug("DAOFactory - Update ChangeFlightDates DAO with new connection");
574      theChangeFlightDates.setConnection(theConnection);
575      }                                           
576      
577    // Tell CustcomerAdd about new Connection
578    if (theCustcomerAdd != null)
579      {                                               
580      theLog.debug("DAOFactory - Update CustcomerAdd DAO with new connection");
581      theCustcomerAdd.setConnection(theConnection);
582      }                                           
583      
584    // Tell CustomerDelete about new Connection
585    if (theCustomerDelete != null)
586      {                                               
587      theLog.debug("DAOFactory - Update CustomerDelete DAO with new connection");
588      theCustomerDelete.setConnection(theConnection);
589      }                                           
590      
591    // Tell CustomerUpdate about new Connection
592    if (theCustomerUpdate != null)
593      {                                               
594      theLog.debug("DAOFactory - Update CustomerUpdate DAO with new connection");
595      theCustomerUpdate.setConnection(theConnection);
596      }                                           
597      
598    // Tell GetFlights about new Connection
599    if (theGetFlights != null)
600      {                                               
601      theLog.debug("DAOFactory - Update GetFlights DAO with new connection");
602      theGetFlights.setConnection(theConnection);
603      }                                           
604      
605    }                                           
606    
607  
608  /**
609  * Get flag that controls whether LOBs are turned into byte[].
610  * @return boolean useByteArraysForLongsAndLOBS 
611  * @since 5.0.2314
612  */
613  public boolean getUseByteArraysForLongsAndLOBS()
614    {
615    return (useByteArraysForLongsAndLOBS);
616    }
617  
618  /**
619  * Set useByteArraysForLongsAndLOBS
620  * @param boolean useByteArraysForLongsAndLOBS Turn lobs into byte[]
621  * @since 5.0.2314
622  */
623  public void setUseByteArraysForLongsAndLOBS(boolean useByteArraysForLongsAndLOBS)
624    {
625    this.useByteArraysForLongsAndLOBS = useByteArraysForLongsAndLOBS;
626    theLog.debug("useByteArraysForLongsAndLOBS set to " + useByteArraysForLongsAndLOBS);
627    }
628  
629  /**
630  * Get keepFiles
631  * @return boolean keepFiles Keep generated files after JVM exits
632  */
633  public boolean getKeepFiles()
634    {
635    return( keepFiles);
636    }                                  
637  
638  /**
639  * Set keepFiles
640  * @param boolean keepFiles Keep generated files after JVM exits
641  */
642  public void setKeepFiles(boolean keepFiles )
643    {
644    this.keepFiles = keepFiles;
645    theLog.debug("keepFiles set to " + keepFiles);
646    }
647  
648  /**
649  * Set keepLobs
650  * @param boolean keepLobs Keep Lobs as pointers rather than turn them into files.
651  * @since 4.0.2108
652  */
653  public void setKeepLobs(boolean keepLobs )
654    {
655    this.keepLobs = keepLobs;
656    theLog.debug("keepLobs set to " + keepLobs);
657    }
658  
659  /**
660  * Get keepLobs
661  * @return boolean keepLobs Keep Lobs as pointers rather than turn them into files.
662  */
663  public boolean getKeepLobs()
664    {
665    return(keepLobs);
666    }                                  
667   
668  /**                                                        
669  * Set Array size for fetches from the database.    
670  * The best value for this parameter is usually about 50.
671  * @param int newSize New number of records to be fetched each time when issuing queries.
672  */                                                         
673  public void setArrayFetchSize(int newSize)      
674    {                                  
675    arrayFetchSize = newSize;               
676     
677    if (theConnection != null)
678      {                                  
679      try
680        {
681        theLog.debug("DAOFactory - Changing array fetch size to " + newSize);
682        // Tell Oracle Driver to send stuff back in batches of arrayFetchSize
683        ((OracleConnection)theConnection).setDefaultRowPrefetch (arrayFetchSize);
684        }
685      catch (java.sql.SQLException e)
686        {
687        theLog.error("DAOFactory - Changing array fetch size failed:");
688        theLog.error(e);
689        }
690      }                            
691      
692    }                            
693                             
694  /**                                                        
695  * Get Array size for fetches from the database.    
696  * @return int Current array fetch size 
697  */                                                         
698  public int getArrayFetchSize()      
699    {                                  
700    return(arrayFetchSize);               
701    }                            
702                             
703  /**                                                        
704  * Set Array size for batch updates.    
705  * If set to a value other than 1 Oracle's JDBC driver will avoid 
706  * talking to the database until it has to. If asked to do an 
707  * INSERT, UPDATE or DELETE it will remember the statement and 
708  * issue it when asked to commit or when the array for batch
709  * updates is full. This feature has nasty side effects
710  * and should be used with care. 
711  */                                                         
712  public void setBatchUpdateSize(int newSize)      
713    {                                  
714    batchUpdateSize = newSize;               
715     
716    if (theConnection != null)
717      {                                  
718      try
719        {
720        theLog.debug("DAOFactory - Changing update batch size to " + newSize);
721        // Tell Oracle Driver to send updates in batches of batchUpdateSize
722        ((OracleConnection)theConnection).setDefaultExecuteBatch (batchUpdateSize);
723        }
724      catch (java.sql.SQLException e)
725        {
726        theLog.error("DAOFactory - Change update batch failed:");
727        theLog.error(e);
728        }
729      }                            
730      
731    }                            
732                             
733  /**                                                        
734  * Get Array size for batch updates.    
735  * @return int Current batch update array size 
736  */                                                         
737  public int getBatchUpdateSize()      
738    {                                  
739    return(batchUpdateSize);               
740    }                            
741                             
742   
743  /**                                                        
744  * Commit changes to the database.    
745  * @throws CSDBException if something goes wrong. This is most likely to 
746  * if <code>batchUpdateSize</code> is a value other than 1. 
747  */                                                         
748  public void commit() throws CSDBException      
749    {                                  
750     
751    if (theConnection != null)
752      {                                  
753      try
754        {
755        theLog.debug("DAOFactory - Committing Changes");
756        theConnection.commit();
757        }
758      catch (java.sql.SQLException e)
759        {
760        theLog.error("DAOFactory - Commit Failed:");
761        theLog.error(e);
762        CSDBException e2 = new CSDBException(e.getErrorCode(),e.getMessage(),"commit","DAOFactory");
763        throw(e2);
764        }
765      }                            
766    }                            
767   
768  /**                                                        
769  * Rollback changes to the database.    
770  */                                                         
771  public void rollback() throws CSException      
772    {                                  
773     
774    if (theConnection != null)
775      {                                  
776      try
777        {
778        theLog.debug("DAOFactory - Rolling back changes");
779        theConnection.rollback();
780        }
781      catch (java.sql.SQLException e)
782        {
783        theLog.error("DAOFactory - Rollback Failed:");
784        theLog.error(e);
785        throw (new CSDBException(e.getErrorCode(),e.getMessage(),"rollback","DAOFactory"));
786        }
787      }                            
788    }                            
789   
790  /**  
791  * Alter a newly created connection object.  
792  * <p> 
793  * If you need to alter the connection after it is created overide this method.
794  * make sure you call 'super();' as the first step. 
795  * <p> 
796  * @param String connectionContext Where in the DAO factory class we are being called from
797  * @param Connection newConnection The new connection object
798  * @since JDBCWizard./a> V5.0.2428 
799  */
800  public void doPostGetConnectionAction(String connectionContext, Connection newConnection) throws CSException 
801    {                                               
802    // This method doesn't do anything unless you override it.
803    }                                               
804   
805   
806  /**  
807  * Confirm that our Connection object is not null. Create one if needed.  
808  * This method's behaviour is controlled by step 4.3.
809  * <p> 
810  * <p> 
811  * If you call the releaseResources() method of this class all existing DAO objects
812  * will lose their Connection objects. In addition to creating making sure a Connection exists this 
813  * method makes sure that all the DAO objects it spawned previously are given the new Connection.
814  * <p> 
815  * @since JDBCWizard./a> V5.0.2428 Support for doPostGetConnectionAction() and doPostGetDataSourceAction()
816  * <p> 
817  * A dedicated Connection object will be created using the value entered as a
818  * Connection Name in step 4.3. JDBCWizard./a>
819  * doesn't verify this value. It should look something like:
820  * <p><code>
821  * jdbc:oracle:thin:username/password@host:port:sid
822  * <p></code> 
823  * For example: 
824  * <p><code>
825  * jdbc:oracle:thin:ORINDADEMO/ORINDADEMO@localhost:1521:ORCL
826  * </code>
827  */       
828  public void confirmConnection(String connectionContext) throws CSException 
829    {                                               
830    if (theConnection == null)
831      {   
832      //
833      // Attempt to load database driver...
834      try
835        {
836        Class.forName ("oracle.jdbc.driver.OracleDriver");
837        }
838      catch (ClassNotFoundException oe)
839        {
840        theLog.error("DAOFactory:Oracle Driver not found " + oe);
841        throw new CSException("Unable to find Oracle driver");
842        }
843      
844      //
845      // Attempt to login to the DB...
846      // The connection string should be in the format:
847      // jdbc:oracle:thin:user/password@hostname:port:sid
848      //
849      try
850        {
851        
852        theConnection = (OracleConnection)java.sql.DriverManager.getConnection (
853             "jdbc:oracle:thin:ORINDADEMO2776/orindademo@demodb.orindasoft.com:1521:XE");
854        
855        theLog.info("Logged in as user " + ((OracleConnection)theConnection).getUserName());
856        
857        // By default JDBC drivers commit automatically. Turn this off...
858        theConnection.setAutoCommit(false);
859        
860        // Tell Oracle Driver to send stuff back in batches of arrayFetchSize
861        ((OracleConnection)theConnection).setDefaultRowPrefetch (arrayFetchSize);
862        
863        // Tell Oracle Driver to send updates in batches of batchUpdateSize
864        ((OracleConnection)theConnection).setDefaultExecuteBatch (batchUpdateSize);
865        
866        if (oracleTimeZoneName != null)
867          {
868          // Tell Oracle Driver what our time zone is so that
869          // oracle.sql.TIMEZONELTZ works
870          ((OracleConnection)theConnection).setSessionTimeZone(oracleTimeZoneName);
871          theLog.debug("Session Time Zone set to '" + oracleTimeZoneName + "'");
872          }
873        
874        }
875      catch (java.sql.SQLException e)
876        {
877        String errorDescription = null;
878        if (e.getMessage().startsWith("Io exception: Connection refused"))
879          {
880          errorDescription = "Io Error: Contact made but connection refused. Check that instance is up and the listener is running";
881          }
882        else if (e.getErrorCode() == 17002 /* Io Exception */)
883          {
884          errorDescription = "Network Error: Check Hostname and Port are valid";
885          }
886        else if (e.getErrorCode() == 1017 /* Invalid Username/Password */)
887          {
888          errorDescription = "Login Error: Check Username and password are valid";
889          }
890        else if (e.getErrorCode() == 1033 /* Startup of Shutdown in progress */)
891          {
892          errorDescription = "Server Error: Startup of Shutdown in progress";
893          }
894        else if (e.getErrorCode() == 12535 /* operation timed out */)
895          {
896          errorDescription = "Io Error: Hostname known but not reachable";
897          }
898      
899        if (errorDescription != null) 
900          {
901          theLog.error("SqlException Thrown in DAOFactory constructor:");
902          theLog.error(errorDescription);
903          throw new CSException(errorDescription);
904          }
905      
906        theLog.error("SqlException Thrown in DAOFactory constructor:");
907        theLog.error(e);
908        throw new CSException(e.toString());
909        }
910      catch (Exception e)
911        {
912        theLog.error("Unexpected Exception Thrown in DAOFactory constructor:");
913        theLog.error(e);
914        throw new CSException(e.toString());
915        }
916      catch (Error e)
917        {
918        theLog.error("Unexpected Error Thrown in DAOFactory constructor:");
919        theLog.error(e.toString());
920        throw new CSException(e.toString());
921        }
922      
923      setConnection(theConnection);
924      }
925    theLog.debug("DAOFactory - Connection Created");
926    }                                           
927    
928  
929   
930  /**  
931  * Confirm that our Connection object is not null. Create one if needed.  
932  * This method's behaviour is controlled by step 4.3.
933  * <p> 
934  */       
935  public void confirmConnection() throws CSException 
936    {
937    confirmConnection(null);
938    }
939   
940  /**  
941  * Get rid of the current database connection.
942  * The behaviour of this method changes according to step 4.3.
943  * @since JDBCWizard./a> 4.0.2098 Connection is only commited if commitOnRelease == true
944  * @since JDBCWizard./a> 4.0.2107 Connection is only closed if closeOnRelease == true
945  * @since JDBCWizard./a> 5.0.2266 Close and Commit are independent of each other
946  */       
947  protected void releaseConnection()  
948    {                                               
949    if (theConnection != null)
950      {   
951      try
952        {
953        if (commitOnRelease)
954          {
955          theLog.debug("DAOFactory - Committing Changes");
956          theConnection.commit();
957          }
958         
959        if (closeOnRelease)
960          {
961          theLog.debug("DAOFactory - Closing Connection");
962          theConnection.close();
963          }
964        }
965      catch (java.sql.SQLException e)
966        {
967        theLog.error(e);
968        }
969      finally
970        {
971        theLog.debug("DAOFactory - Setting connection to null");
972        theConnection = null;
973        }
974      }
975    theLog.debug("DAOFactory - Connection Released");
976    }
977    
978  
979  /** 
980  * Get DAO to access PL/SQL CURSOR_EXAMPLE.DIRECT_FLIGHT_AVAILABLE
981  * This method either creates a new instance of the access class or 
982  * returns the existing instance. Note that it does not spawn a new instance 
983  * each time its called. 
984  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
985  * @return com.orindasoft.demo.generated.plsql.CursorExampleDirectFlightAvailable
986  */ 
987  public com.orindasoft.demo.generated.plsql.CursorExampleDirectFlightAvailable getCursorExampleDirectFlightAvailablePlSqlDAO() throws CSException
988    {                                               
989    confirmConnection("getCursorExampleDirectFlightAvailablePlSqlDAO");
990    
991    if (theCursorExampleDirectFlightAvailable == null)
992      {                                               
993      theLog.debug("DAOFactory - Creating DAO to access CURSOR_EXAMPLE.DIRECT_FLIGHT_AVAILABLE");
994      theCursorExampleDirectFlightAvailable = new com.orindasoft.demo.generated.plsql.CursorExampleDirectFlightAvailable(theConnection, theLog);
995      }                                           
996    
997    theLog.debug("DAOFactory - Returning DAO to access CURSOR_EXAMPLE.DIRECT_FLIGHT_AVAILABLE");
998    return(theCursorExampleDirectFlightAvailable);
999    }                                           
000    
001  /** 
002  * Get DAO to access PL/SQL CURSOR_EXAMPLE.FIND_DIRECT_FLIGHTS
003  * This method either creates a new instance of the access class or 
004  * returns the existing instance. Note that it does not spawn a new instance 
005  * each time its called. 
006  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
007  * @return com.orindasoft.demo.generated.plsql.CursorExampleFindDirectFlights
008  */ 
009  public com.orindasoft.demo.generated.plsql.CursorExampleFindDirectFlights getCursorExampleFindDirectFlightsPlSqlDAO() throws CSException
010    {                                               
011    confirmConnection("getCursorExampleFindDirectFlightsPlSqlDAO");
012    
013    if (theCursorExampleFindDirectFlights == null)
014      {                                               
015      theLog.debug("DAOFactory - Creating DAO to access CURSOR_EXAMPLE.FIND_DIRECT_FLIGHTS");
016      theCursorExampleFindDirectFlights = new com.orindasoft.demo.generated.plsql.CursorExampleFindDirectFlights(theConnection, theLog);
017      
018      // Set temporary file directory etc.
019      theCursorExampleFindDirectFlights.setBufferSize(getBufferSize());
020      theCursorExampleFindDirectFlights.setKeepFiles(getKeepFiles());
021      theCursorExampleFindDirectFlights.setKeepLobs(getKeepLobs());
022      theCursorExampleFindDirectFlights.setTempDir(getTempFileDir());
023      theCursorExampleFindDirectFlights.setTempFilePrefix(getTempFilePrefix());
024      theCursorExampleFindDirectFlights.setTempFileSuffix(getTempFileSuffix());
025      theCursorExampleFindDirectFlights.setUseByteArraysForLongsAndLOBS(useByteArraysForLongsAndLOBS);
026      theCursorExampleFindDirectFlights.setCreateTempLobsIfNeeded(true);
027      theCursorExampleFindDirectFlights.setDeleteTempLobsAfterCall(true);
028      }                                           
029    
030    theLog.debug("DAOFactory - Returning DAO to access CURSOR_EXAMPLE.FIND_DIRECT_FLIGHTS");
031    return(theCursorExampleFindDirectFlights);
032    }                                           
033    
034  /** 
035  * Get DAO to access PL/SQL CURSOR_EXAMPLE.GETLISTS
036  * This method either creates a new instance of the access class or 
037  * returns the existing instance. Note that it does not spawn a new instance 
038  * each time its called. 
039  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
040  * @return com.orindasoft.demo.generated.plsql.CursorExampleGetlists
041  */ 
042  public com.orindasoft.demo.generated.plsql.CursorExampleGetlists getCursorExampleGetlistsPlSqlDAO() throws CSException
043    {                                               
044    confirmConnection("getCursorExampleGetlistsPlSqlDAO");
045    
046    if (theCursorExampleGetlists == null)
047      {                                               
048      theLog.debug("DAOFactory - Creating DAO to access CURSOR_EXAMPLE.GETLISTS");
049      theCursorExampleGetlists = new com.orindasoft.demo.generated.plsql.CursorExampleGetlists(theConnection, theLog);
050      
051      // Set temporary file directory etc.
052      theCursorExampleGetlists.setBufferSize(getBufferSize());
053      theCursorExampleGetlists.setKeepFiles(getKeepFiles());
054      theCursorExampleGetlists.setKeepLobs(getKeepLobs());
055      theCursorExampleGetlists.setTempDir(getTempFileDir());
056      theCursorExampleGetlists.setTempFilePrefix(getTempFilePrefix());
057      theCursorExampleGetlists.setTempFileSuffix(getTempFileSuffix());
058      theCursorExampleGetlists.setUseByteArraysForLongsAndLOBS(useByteArraysForLongsAndLOBS);
059      theCursorExampleGetlists.setCreateTempLobsIfNeeded(true);
060      theCursorExampleGetlists.setDeleteTempLobsAfterCall(true);
061      }                                           
062    
063    theLog.debug("DAOFactory - Returning DAO to access CURSOR_EXAMPLE.GETLISTS");
064    return(theCursorExampleGetlists);
065    }                                           
066    
067  /** 
068  * Get DAO to access PL/SQL OBJECT_ARRAY_EXAMPLE.ADD_BOOKINGS_OBJECT_ARRAY
069  * This method either creates a new instance of the access class or 
070  * returns the existing instance. Note that it does not spawn a new instance 
071  * each time its called. 
072  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
073  * @return com.orindasoft.demo.generated.plsql.ObjectArrayExampleAddBookingsObjectArray
074  */ 
075  public com.orindasoft.demo.generated.plsql.ObjectArrayExampleAddBookingsObjectArray getObjectArrayExampleAddBookingsObjectArrayPlSqlDAO() throws CSException
076    {                                               
077    confirmConnection("getObjectArrayExampleAddBookingsObjectArrayPlSqlDAO");
078    
079    if (theObjectArrayExampleAddBookingsObjectArray == null)
080      {                                               
081      theLog.debug("DAOFactory - Creating DAO to access OBJECT_ARRAY_EXAMPLE.ADD_BOOKINGS_OBJECT_ARRAY");
082      theObjectArrayExampleAddBookingsObjectArray = new com.orindasoft.demo.generated.plsql.ObjectArrayExampleAddBookingsObjectArray(theConnection, theLog);
083      }                                           
084    
085    theLog.debug("DAOFactory - Returning DAO to access OBJECT_ARRAY_EXAMPLE.ADD_BOOKINGS_OBJECT_ARRAY");
086    return(theObjectArrayExampleAddBookingsObjectArray);
087    }                                           
088    
089  /** 
090  * Get DAO to access PL/SQL OBJECT_ARRAY_EXAMPLE.GET_OBJECT_ARRAY_OF_FLIGHTS
091  * This method either creates a new instance of the access class or 
092  * returns the existing instance. Note that it does not spawn a new instance 
093  * each time its called. 
094  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
095  * @return com.orindasoft.demo.generated.plsql.ObjectArrayExampleGetObjectArrayOfFlights
096  */ 
097  public com.orindasoft.demo.generated.plsql.ObjectArrayExampleGetObjectArrayOfFlights getObjectArrayExampleGetObjectArrayOfFlightsPlSqlDAO() throws CSException
098    {                                               
099    confirmConnection("getObjectArrayExampleGetObjectArrayOfFlightsPlSqlDAO");
100    
101    if (theObjectArrayExampleGetObjectArrayOfFlights == null)
102      {                                               
103      theLog.debug("DAOFactory - Creating DAO to access OBJECT_ARRAY_EXAMPLE.GET_OBJECT_ARRAY_OF_FLIGHTS");
104      theObjectArrayExampleGetObjectArrayOfFlights = new com.orindasoft.demo.generated.plsql.ObjectArrayExampleGetObjectArrayOfFlights(theConnection, theLog);
105      }                                           
106    
107    theLog.debug("DAOFactory - Returning DAO to access OBJECT_ARRAY_EXAMPLE.GET_OBJECT_ARRAY_OF_FLIGHTS");
108    return(theObjectArrayExampleGetObjectArrayOfFlights);
109    }                                           
110    
111  /** 
112  * Get DAO to access PL/SQL PACKAGE_ARRAY_EXAMPLE.ADD_BOOKINGS_PLSQL_ARRAY
113  * This method either creates a new instance of the access class or 
114  * returns the existing instance. Note that it does not spawn a new instance 
115  * each time its called. 
116  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
117  * @return com.orindasoft.demo.generated.plsql.PackageArrayExampleAddBookingsPlsqlArray
118  */ 
119  public com.orindasoft.demo.generated.plsql.PackageArrayExampleAddBookingsPlsqlArray getPackageArrayExampleAddBookingsPlsqlArrayPlSqlDAO() throws CSException
120    {                                               
121    confirmConnection("getPackageArrayExampleAddBookingsPlsqlArrayPlSqlDAO");
122    
123    if (thePackageArrayExampleAddBookingsPlsqlArray == null)
124      {                                               
125      theLog.debug("DAOFactory - Creating DAO to access PACKAGE_ARRAY_EXAMPLE.ADD_BOOKINGS_PLSQL_ARRAY");
126      thePackageArrayExampleAddBookingsPlsqlArray = new com.orindasoft.demo.generated.plsql.PackageArrayExampleAddBookingsPlsqlArray(theConnection, theLog);
127      }                                           
128    
129    theLog.debug("DAOFactory - Returning DAO to access PACKAGE_ARRAY_EXAMPLE.ADD_BOOKINGS_PLSQL_ARRAY");
130    return(thePackageArrayExampleAddBookingsPlsqlArray);
131    }                                           
132    
133  /** 
134  * Get DAO to access PL/SQL PACKAGE_ARRAY_EXAMPLE.GET_PLSQL_ARRAY_OF_FLIGHTS
135  * This method either creates a new instance of the access class or 
136  * returns the existing instance. Note that it does not spawn a new instance 
137  * each time its called. 
138  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
139  * @return com.orindasoft.demo.generated.plsql.PackageArrayExampleGetPlsqlArrayOfFlights
140  */ 
141  public com.orindasoft.demo.generated.plsql.PackageArrayExampleGetPlsqlArrayOfFlights getPackageArrayExampleGetPlsqlArrayOfFlightsPlSqlDAO() throws CSException
142    {                                               
143    confirmConnection("getPackageArrayExampleGetPlsqlArrayOfFlightsPlSqlDAO");
144    
145    if (thePackageArrayExampleGetPlsqlArrayOfFlights == null)
146      {                                               
147      theLog.debug("DAOFactory - Creating DAO to access PACKAGE_ARRAY_EXAMPLE.GET_PLSQL_ARRAY_OF_FLIGHTS");
148      thePackageArrayExampleGetPlsqlArrayOfFlights = new com.orindasoft.demo.generated.plsql.PackageArrayExampleGetPlsqlArrayOfFlights(theConnection, theLog);
149      }                                           
150    
151    theLog.debug("DAOFactory - Returning DAO to access PACKAGE_ARRAY_EXAMPLE.GET_PLSQL_ARRAY_OF_FLIGHTS");
152    return(thePackageArrayExampleGetPlsqlArrayOfFlights);
153    }                                           
154    
155  /** 
156  * Get DAO to access PL/SQL PACKAGE_IDXARRAY_EXAMPLE.ADD_BOOKINGS_PLSQL_ARRAY
157  * This method either creates a new instance of the access class or 
158  * returns the existing instance. Note that it does not spawn a new instance 
159  * each time its called. 
160  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
161  * @return com.orindasoft.demo.generated.plsql.PackageIdxarrayExampleAddBookingsPlsqlArray
162  */ 
163  public com.orindasoft.demo.generated.plsql.PackageIdxarrayExampleAddBookingsPlsqlArray getPackageIdxarrayExampleAddBookingsPlsqlArrayPlSqlDAO() throws CSException
164    {                                               
165    confirmConnection("getPackageIdxarrayExampleAddBookingsPlsqlArrayPlSqlDAO");
166    
167    if (thePackageIdxarrayExampleAddBookingsPlsqlArray == null)
168      {                                               
169      theLog.debug("DAOFactory - Creating DAO to access PACKAGE_IDXARRAY_EXAMPLE.ADD_BOOKINGS_PLSQL_ARRAY");
170      thePackageIdxarrayExampleAddBookingsPlsqlArray = new com.orindasoft.demo.generated.plsql.PackageIdxarrayExampleAddBookingsPlsqlArray(theConnection, theLog);
171      }                                           
172    
173    theLog.debug("DAOFactory - Returning DAO to access PACKAGE_IDXARRAY_EXAMPLE.ADD_BOOKINGS_PLSQL_ARRAY");
174    return(thePackageIdxarrayExampleAddBookingsPlsqlArray);
175    }                                           
176    
177  /** 
178  * Get DAO to access PL/SQL PACKAGE_IDXARRAY_EXAMPLE.GET_PLSQL_ARRAY_OF_FLIGHTS
179  * This method either creates a new instance of the access class or 
180  * returns the existing instance. Note that it does not spawn a new instance 
181  * each time its called. 
182  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
183  * @return com.orindasoft.demo.generated.plsql.PackageIdxarrayExampleGetPlsqlArrayOfFlights
184  */ 
185  public com.orindasoft.demo.generated.plsql.PackageIdxarrayExampleGetPlsqlArrayOfFlights getPackageIdxarrayExampleGetPlsqlArrayOfFlightsPlSqlDAO() throws CSException
186    {                                               
187    confirmConnection("getPackageIdxarrayExampleGetPlsqlArrayOfFlightsPlSqlDAO");
188    
189    if (thePackageIdxarrayExampleGetPlsqlArrayOfFlights == null)
190      {                                               
191      theLog.debug("DAOFactory - Creating DAO to access PACKAGE_IDXARRAY_EXAMPLE.GET_PLSQL_ARRAY_OF_FLIGHTS");
192      thePackageIdxarrayExampleGetPlsqlArrayOfFlights = new com.orindasoft.demo.generated.plsql.PackageIdxarrayExampleGetPlsqlArrayOfFlights(theConnection, theLog);
193      }                                           
194    
195    theLog.debug("DAOFactory - Returning DAO to access PACKAGE_IDXARRAY_EXAMPLE.GET_PLSQL_ARRAY_OF_FLIGHTS");
196    return(thePackageIdxarrayExampleGetPlsqlArrayOfFlights);
197    }                                           
198    
199  /** 
200  * Get DAO to access Table AIRCRAFT
201  * This method either creates a new instance of the access class or 
202  * returns the existing instance. Note that it does not spawn a new instance 
203  * each time its called. 
204  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
205  * @return com.orindasoft.demo.generated.table.manager.AircraftMgr
206  */ 
207  public com.orindasoft.demo.generated.table.manager.AircraftMgr getAircraftTableDAO() throws CSException
208    {                                               
209    confirmConnection("getAircraftTableDAO");
210     
211    if (TheAircraftMgr == null)
212      {                                               
213      theLog.debug("DAOFactory - Creating DAO to access AIRCRAFT");
214      TheAircraftMgr = new com.orindasoft.demo.generated.table.manager.AircraftMgr(theConnection, theLog);
215      }                                           
216    
217    theLog.debug("DAOFactory - Returning DAO to access AIRCRAFT");
218    return(TheAircraftMgr);
219    }                                           
220    
221  /** 
222  * Get DAO to access Table AIRLINES
223  * This method either creates a new instance of the access class or 
224  * returns the existing instance. Note that it does not spawn a new instance 
225  * each time its called. 
226  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
227  * @return com.orindasoft.demo.generated.table.manager.AirlinesMgr
228  */ 
229  public com.orindasoft.demo.generated.table.manager.AirlinesMgr getAirlinesTableDAO() throws CSException
230    {                                               
231    confirmConnection("getAirlinesTableDAO");
232     
233    if (TheAirlinesMgr == null)
234      {                                               
235      theLog.debug("DAOFactory - Creating DAO to access AIRLINES");
236      TheAirlinesMgr = new com.orindasoft.demo.generated.table.manager.AirlinesMgr(theConnection, theLog);
237      }                                           
238    
239    theLog.debug("DAOFactory - Returning DAO to access AIRLINES");
240    return(TheAirlinesMgr);
241    }                                           
242    
243  /** 
244  * Get DAO to access Table AIRPORTS
245  * This method either creates a new instance of the access class or 
246  * returns the existing instance. Note that it does not spawn a new instance 
247  * each time its called. 
248  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
249  * @return com.orindasoft.demo.generated.table.manager.AirportsMgr
250  */ 
251  public com.orindasoft.demo.generated.table.manager.AirportsMgr getAirportsTableDAO() throws CSException
252    {                                               
253    confirmConnection("getAirportsTableDAO");
254     
255    if (TheAirportsMgr == null)
256      {                                               
257      theLog.debug("DAOFactory - Creating DAO to access AIRPORTS");
258      TheAirportsMgr = new com.orindasoft.demo.generated.table.manager.AirportsMgr(theConnection, theLog);
259      }                                           
260    
261    theLog.debug("DAOFactory - Returning DAO to access AIRPORTS");
262    return(TheAirportsMgr);
263    }                                           
264    
265  /** 
266  * Get DAO to access Table BOOKINGS
267  * This method either creates a new instance of the access class or 
268  * returns the existing instance. Note that it does not spawn a new instance 
269  * each time its called. 
270  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
271  * @return com.orindasoft.demo.generated.table.manager.BookingsMgr
272  */ 
273  public com.orindasoft.demo.generated.table.manager.BookingsMgr getBookingsTableDAO() throws CSException
274    {                                               
275    confirmConnection("getBookingsTableDAO");
276     
277    if (TheBookingsMgr == null)
278      {                                               
279      theLog.debug("DAOFactory - Creating DAO to access BOOKINGS");
280      TheBookingsMgr = new com.orindasoft.demo.generated.table.manager.BookingsMgr(theConnection, theLog);
281      }                                           
282    
283    theLog.debug("DAOFactory - Returning DAO to access BOOKINGS");
284    return(TheBookingsMgr);
285    }                                           
286    
287  /** 
288  * Get DAO to access Table CUSTOMERS
289  * This method either creates a new instance of the access class or 
290  * returns the existing instance. Note that it does not spawn a new instance 
291  * each time its called. 
292  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
293  * @return com.orindasoft.demo.generated.table.manager.CustomersMgr
294  */ 
295  public com.orindasoft.demo.generated.table.manager.CustomersMgr getCustomersTableDAO() throws CSException
296    {                                               
297    confirmConnection("getCustomersTableDAO");
298     
299    if (TheCustomersMgr == null)
300      {                                               
301      theLog.debug("DAOFactory - Creating DAO to access CUSTOMERS");
302      TheCustomersMgr = new com.orindasoft.demo.generated.table.manager.CustomersMgr(theConnection, theLog);
303      }                                           
304    
305    theLog.debug("DAOFactory - Returning DAO to access CUSTOMERS");
306    return(TheCustomersMgr);
307    }                                           
308    
309  /** 
310  * Get DAO to access Table FLIGHTS
311  * This method either creates a new instance of the access class or 
312  * returns the existing instance. Note that it does not spawn a new instance 
313  * each time its called. 
314  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
315  * @return com.orindasoft.demo.generated.table.manager.FlightsMgr
316  */ 
317  public com.orindasoft.demo.generated.table.manager.FlightsMgr getFlightsTableDAO() throws CSException
318    {                                               
319    confirmConnection("getFlightsTableDAO");
320     
321    if (TheFlightsMgr == null)
322      {                                               
323      theLog.debug("DAOFactory - Creating DAO to access FLIGHTS");
324      TheFlightsMgr = new com.orindasoft.demo.generated.table.manager.FlightsMgr(theConnection, theLog);
325      }                                           
326    
327    theLog.debug("DAOFactory - Returning DAO to access FLIGHTS");
328    return(TheFlightsMgr);
329    }                                           
330    
331  /** 
332  * Get DAO to access Sequence SEQUENTIAL_NUMBER_GENERATOR
333  * This method either creates a new instance of the access class or 
334  * returns the existing instance. Note that it does not spawn a new instance 
335  * each time its called. 
336  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
337  * @return com.orindasoft.demo.generated.sequence.SequentialNumberGenerator
338  */ 
339  public com.orindasoft.demo.generated.sequence.SequentialNumberGenerator getSequentialNumberGeneratorSequenceDAO()  throws CSException
340    {                                               
341    confirmConnection("getSequentialNumberGeneratorSequenceDAO");
342     
343    if (theSequentialNumberGenerator == null)
344      {                                               
345      theLog.debug("DAOFactory - Creating DAO to access SEQUENTIAL_NUMBER_GENERATOR");
346      theSequentialNumberGenerator = new com.orindasoft.demo.generated.sequence.SequentialNumberGenerator(theConnection, theLog);
347      }                                           
348    
349    theLog.debug("DAOFactory - Returning DAO to access SEQUENTIAL_NUMBER_GENERATOR");
350    return(theSequentialNumberGenerator);
351    }                                           
352    
353  /** 
354  * Get DAO to access SQL Statement ChangeFlightDates
355  * This method either creates a new instance of the access class or 
356  * returns the existing instance. Note that it does not spawn a new instance 
357  * each time its called. 
358  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
359  * @return com.orindasoft.demo.generated.sql.ChangeFlightDates
360  */ 
361  public com.orindasoft.demo.generated.sql.ChangeFlightDates getChangeFlightDatesSqlDAO() throws CSException
362    {                                               
363    confirmConnection("getChangeFlightDatesSqlDAO");
364     
365    if (theChangeFlightDates == null)
366      {                                               
367      theLog.debug("DAOFactory - Creating DAO to access ChangeFlightDates");
368      theChangeFlightDates = new com.orindasoft.demo.generated.sql.ChangeFlightDates(theConnection, theLog);
369      }                                           
370    
371    theLog.debug("DAOFactory - Returning DAO to access ChangeFlightDates");
372    return(theChangeFlightDates);
373    }                                           
374    
375  /** 
376  * Get DAO to access SQL Statement CustcomerAdd
377  * This method either creates a new instance of the access class or 
378  * returns the existing instance. Note that it does not spawn a new instance 
379  * each time its called. 
380  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
381  * @return com.orindasoft.demo.generated.sql.CustcomerAdd
382  */ 
383  public com.orindasoft.demo.generated.sql.CustcomerAdd getCustcomerAddSqlDAO() throws CSException
384    {                                               
385    confirmConnection("getCustcomerAddSqlDAO");
386     
387    if (theCustcomerAdd == null)
388      {                                               
389      theLog.debug("DAOFactory - Creating DAO to access CustcomerAdd");
390      theCustcomerAdd = new com.orindasoft.demo.generated.sql.CustcomerAdd(theConnection, theLog);
391      }                                           
392    
393    theLog.debug("DAOFactory - Returning DAO to access CustcomerAdd");
394    return(theCustcomerAdd);
395    }                                           
396    
397  /** 
398  * Get DAO to access SQL Statement CustomerDelete
399  * This method either creates a new instance of the access class or 
400  * returns the existing instance. Note that it does not spawn a new instance 
401  * each time its called. 
402  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
403  * @return com.orindasoft.demo.generated.sql.CustomerDelete
404  */ 
405  public com.orindasoft.demo.generated.sql.CustomerDelete getCustomerDeleteSqlDAO() throws CSException
406    {                                               
407    confirmConnection("getCustomerDeleteSqlDAO");
408     
409    if (theCustomerDelete == null)
410      {                                               
411      theLog.debug("DAOFactory - Creating DAO to access CustomerDelete");
412      theCustomerDelete = new com.orindasoft.demo.generated.sql.CustomerDelete(theConnection, theLog);
413      }                                           
414    
415    theLog.debug("DAOFactory - Returning DAO to access CustomerDelete");
416    return(theCustomerDelete);
417    }                                           
418    
419  /** 
420  * Get DAO to access SQL Statement CustomerUpdate
421  * This method either creates a new instance of the access class or 
422  * returns the existing instance. Note that it does not spawn a new instance 
423  * each time its called. 
424  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
425  * @return com.orindasoft.demo.generated.sql.CustomerUpdate
426  */ 
427  public com.orindasoft.demo.generated.sql.CustomerUpdate getCustomerUpdateSqlDAO() throws CSException
428    {                                               
429    confirmConnection("getCustomerUpdateSqlDAO");
430     
431    if (theCustomerUpdate == null)
432      {                                               
433      theLog.debug("DAOFactory - Creating DAO to access CustomerUpdate");
434      theCustomerUpdate = new com.orindasoft.demo.generated.sql.CustomerUpdate(theConnection, theLog);
435      }                                           
436    
437    theLog.debug("DAOFactory - Returning DAO to access CustomerUpdate");
438    return(theCustomerUpdate);
439    }                                           
440    
441  /** 
442  * Get DAO to access SQL Statement GetFlights
443  * This method either creates a new instance of the access class or 
444  * returns the existing instance. Note that it does not spawn a new instance 
445  * each time its called. 
446  * @since JDBCWizard./a> 4.0.2139 confirmConnection() is called for existing DAO objects as well as new ones
447  * @return com.orindasoft.demo.generated.sql.GetFlights
448  */ 
449  public com.orindasoft.demo.generated.sql.GetFlights getGetFlightsSqlDAO() throws CSException
450    {                                               
451    confirmConnection("getGetFlightsSqlDAO");
452     
453    if (theGetFlights == null)
454      {                                               
455      theLog.debug("DAOFactory - Creating DAO to access GetFlights");
456      theGetFlights = new com.orindasoft.demo.generated.sql.GetFlights(theConnection, theLog);
457      
458      // Set temporary file directory etc.
459      theGetFlights.setBufferSize(getBufferSize());
460      theGetFlights.setKeepFiles(getKeepFiles());
461      theGetFlights.setKeepLobs(getKeepLobs());
462      theGetFlights.setTempDir(getTempFileDir());
463      theGetFlights.setTempFilePrefix(getTempFilePrefix());
464      theGetFlights.setTempFileSuffix(getTempFileSuffix());
465      theGetFlights.setUseByteArraysForLongsAndLOBS(useByteArraysForLongsAndLOBS);
466      }                                           
467    
468    theLog.debug("DAOFactory - Returning DAO to access GetFlights");
469    return(theGetFlights);
470    }                                           
471    
472   
473  /** 
474  * Release all db resources that we know to be in use. Further attempts to use this 
475  *  will fail until we are given another connection to play with. 
476  * We explicitly rollback at the end of this method. 
477  *  @return boolean <code>true</code> if we didn't encounter any problems, otherwise <code>false</code> 
478  */ 
479   
480  public boolean releaseResources() 
481    { 
482    boolean returnCode = true; 
483    
484    theLog.debug("DAOFactory - Attempting to release connection");
485    
486    try 
487      { 
488      if (batchCommitStatement != null)
489        { 
490        batchCommitStatement.close(); 
491        batchCommitStatement = null; 
492        } 
493      
494      if (theCursorExampleDirectFlightAvailable != null)
495        { 
496        if (theCursorExampleDirectFlightAvailable.hasResources())
497          { 
498          theCursorExampleDirectFlightAvailable.releaseResources(); 
499          } 
500        } 
501      
502      if (theCursorExampleFindDirectFlights != null)
503        { 
504        if (theCursorExampleFindDirectFlights.hasResources())
505          { 
506          theCursorExampleFindDirectFlights.releaseResources(); 
507          } 
508        } 
509      
510      if (theCursorExampleGetlists != null)
511        { 
512        if (theCursorExampleGetlists.hasResources())
513          { 
514          theCursorExampleGetlists.releaseResources(); 
515          } 
516        } 
517      
518      if (theObjectArrayExampleAddBookingsObjectArray != null)
519        { 
520        if (theObjectArrayExampleAddBookingsObjectArray.hasResources())
521          { 
522          theObjectArrayExampleAddBookingsObjectArray.releaseResources(); 
523          } 
524        } 
525      
526      if (theObjectArrayExampleGetObjectArrayOfFlights != null)
527        { 
528        if (theObjectArrayExampleGetObjectArrayOfFlights.hasResources())
529          { 
530          theObjectArrayExampleGetObjectArrayOfFlights.releaseResources(); 
531          } 
532        } 
533      
534      if (thePackageArrayExampleAddBookingsPlsqlArray != null)
535        { 
536        if (thePackageArrayExampleAddBookingsPlsqlArray.hasResources())
537          { 
538          thePackageArrayExampleAddBookingsPlsqlArray.releaseResources(); 
539          } 
540        } 
541      
542      if (thePackageArrayExampleGetPlsqlArrayOfFlights != null)
543        { 
544        if (thePackageArrayExampleGetPlsqlArrayOfFlights.hasResources())
545          { 
546          thePackageArrayExampleGetPlsqlArrayOfFlights.releaseResources(); 
547          } 
548        } 
549      
550      if (thePackageIdxarrayExampleAddBookingsPlsqlArray != null)
551        { 
552        if (thePackageIdxarrayExampleAddBookingsPlsqlArray.hasResources())
553          { 
554          thePackageIdxarrayExampleAddBookingsPlsqlArray.releaseResources(); 
555          } 
556        } 
557      
558      if (thePackageIdxarrayExampleGetPlsqlArrayOfFlights != null)
559        { 
560        if (thePackageIdxarrayExampleGetPlsqlArrayOfFlights.hasResources())
561          { 
562          thePackageIdxarrayExampleGetPlsqlArrayOfFlights.releaseResources(); 
563          } 
564        } 
565      
566      if (TheAircraftMgr != null)
567        { 
568        if (TheAircraftMgr.hasResources())
569          { 
570          TheAircraftMgr.releaseResources(); 
571          } 
572        } 
573      
574      if (TheAirlinesMgr != null)
575        { 
576        if (TheAirlinesMgr.hasResources())
577          { 
578          TheAirlinesMgr.releaseResources(); 
579          } 
580        } 
581      
582      if (TheAirportsMgr != null)
583        { 
584        if (TheAirportsMgr.hasResources())
585          { 
586          TheAirportsMgr.releaseResources(); 
587          } 
588        } 
589      
590      if (TheBookingsMgr != null)
591        { 
592        if (TheBookingsMgr.hasResources())
593          { 
594          TheBookingsMgr.releaseResources(); 
595          } 
596        } 
597      
598      if (TheCustomersMgr != null)
599        { 
600        if (TheCustomersMgr.hasResources())
601          { 
602          TheCustomersMgr.releaseResources(); 
603          } 
604        } 
605      
606      if (TheFlightsMgr != null)
607        { 
608        if (TheFlightsMgr.hasResources())
609          { 
610          TheFlightsMgr.releaseResources(); 
611          } 
612        } 
613      
614      if (theSequentialNumberGenerator != null)
615        { 
616        if (theSequentialNumberGenerator.hasResources())
617          { 
618          theSequentialNumberGenerator.releaseResources(); 
619          } 
620        } 
621      
622      if (theChangeFlightDates != null)
623        { 
624        if (theChangeFlightDates.hasResources())
625          { 
626          theChangeFlightDates.releaseResources(); 
627          } 
628        } 
629      
630      if (theCustcomerAdd != null)
631        { 
632        if (theCustcomerAdd.hasResources())
633          { 
634          theCustcomerAdd.releaseResources(); 
635          } 
636        } 
637      
638      if (theCustomerDelete != null)
639        { 
640        if (theCustomerDelete.hasResources())
641          { 
642          theCustomerDelete.releaseResources(); 
643          } 
644        } 
645      
646      if (theCustomerUpdate != null)
647        { 
648        if (theCustomerUpdate.hasResources())
649          { 
650          theCustomerUpdate.releaseResources(); 
651          } 
652        } 
653      
654      if (theGetFlights != null)
655        { 
656        if (theGetFlights.hasResources())
657          { 
658          theGetFlights.releaseResources(); 
659          } 
660        } 
661      } 
662    catch (Exception e) 
663      { 
664      theLog.warning(e.toString()); 
665      returnCode = false; 
666      } 
667    
668    releaseConnection();
669    theLog.debug("DAOFactory- Finished releasing connection");
670    
671    return(returnCode); 
672    } 
673  
674  /** 
675  * Check to see if we are using Oracle Resources
676  *  will fail until we are given another connection to play with. 
677  * We explicitly rollback at the end of this method. 
678  * @return <code>true</code> if we are using resources
679  * @return <code>false</code> if we are not using resources
680  */ 
681  public boolean hasResources() 
682    { 
683    if (theConnection == null) 
684      { 
685      return (false); 
686      } 
687    
688    return(true); 
689    } 
690  
691  /**
692  * Set new file io buffer size. This will only affect DAO's created after this method is called
693  * @param int bufferSize A new Buffer size in bytes.
694  * @since 4.0.2043
695  */
696  public void setBufferSize(int bufferSize)
697    {
698    this.bufferSize = bufferSize;
699    theLog.debug("bufferSize set to " + bufferSize);
700    }
701  
702  /**
703  * Set new value for the commit-on-release flag
704  * @param boolean commitOnRelease Whether this class should commit connections when they are no longer needed.
705  * @since JDBCWizard./a> 4.0.2098
706  */
707  public void setCommitOnRelease(boolean commitOnRelease)
708    {
709    this.commitOnRelease = commitOnRelease;
710    theLog.debug("commitOnRelease set to " + commitOnRelease);
711    }
712  
713  /**
714  * Set new value for the close-on-release flag
715  * @param boolean closeOnRelease Whether this class should close connections when they are no longer needed.
716  * @since JDBCWizard./a> 4.0.2107
717  */
718  public void setCloseOnRelease(boolean closeOnRelease)
719    {
720    this.closeOnRelease = closeOnRelease;
721    theLog.debug("closeOnRelease set to " + closeOnRelease);
722    }
723  
724  /**
725  * Return current LogInterface object.
726  * Returns the current logging object.
727  * @return com.orindasoft.pub.LogInterface
728  * @since 5.0.2023
729  */
730  public com.orindasoft.pub.LogInterface getCurrentLogInterface()
731    {
732    return(theLog);
733    }
734  
735  /**
736  * Return a long object loader.
737  * The variable lobLoader is null until this method is called for the first time.
738  * @return com.orindasoft.pub.LongObjectLoader A long object loader
739  * @since 4.0.2108
740  */
741  public com.orindasoft.pub.LongObjectLoader getLoader()
742    {
743    if (lobLoader == null)                                   
744      {                                                             
745      lobLoader = new com.orindasoft.pub.LongObjectLoader(); 
746      }                                      
747     
748    lobLoader.setBufferSize(bufferSize);
749     
750    return(lobLoader);
751    }
752  
753  /**
754  * Set temporary directory - only affects DAOs created after this method is called
755  * @param java.io.File tempFileDir a new Temporary Directory
756  * @throws CSException if the directory is not viable
757  * @since 4.0.2043
758  */
759  public void setTempDir(java.io.File tempFileDir) throws CSException
760    {
761    if (tempFileDir == null)                                   
762      {                                                             
763      throw (new CSException("Attempt made to set tempFileDir to null")); 
764      }                                      
765    else if (! tempFileDir.exists())       
766      {       
767      try    
768        {     
769        theLog.info("Creating temporary directory " + tempFileDir.getAbsolutePath()); 
770        tempFileDir.mkdirs(); 
771        }  
772      catch (Exception e) 
773        { 
774        throw (new CSException("tempFileDir " + tempFileDir.getAbsolutePath() + " can not be created"));  
775        } 
776      }  
777    
778    this.tempFileDir = tempFileDir;
779    theLog.debug("tempFileDir set to " + tempFileDir.getAbsolutePath());
780    }
781  
782  /**
783  * Set the prefix used for generating temporary files
784  * @since 4.0.2043
785  */
786  public void setTempFilePrefix(String tempFilePrefix)
787    {
788    this.tempFilePrefix = tempFilePrefix;
789    }
790  
791  /**
792  * Set the suffix used for generating temporary files
793  * @since 4.0.2043
794  */
795  public void setTempFileSuffix(String tempFileSuffix)
796    {
797    this.tempFileSuffix = tempFileSuffix;
798    }
799  
800  /**
801  * Get current file io buffer size
802  * @return int bufferSize Buffer size in bytes.
803  */
804  public int getBufferSize()
805    {
806    return (bufferSize);
807    }
808  
809  /**
810  * Get current temporary directory
811  * @return java.io.File tempFileDir the temporary Directory
812  */
813  public java.io.File getTempFileDir()
814    {
815    return(tempFileDir);
816    }
817  
818  /**
819  * Get current prefix used for generating temporary files
820  */
821  public String getTempFilePrefix()
822    {
823    return (tempFilePrefix);
824    }
825  
826  /**
827  * Get current suffix used for generating temporary files
828  */
829  public String getTempFileSuffix()
830    {
831    return (tempFileSuffix);
832    }
833  
834  } // Generated by JDBCWizard./a> 6.0.2776  
835