View Javadoc

1   /***
2    *  The contents of this file are subject to the Mozilla Public
3    *  License Version 1.1 (the "License"); you may not use this file
4    *  except in compliance with the License. You may obtain a copy of
5    *  the License at http://www.mozilla.org/MPL/
6    * 
7    *  Software distributed under the License is distributed on an "AS
8    *  IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9    *  implied. See the License for the specific language governing
10   *  rights and limitations under the License.
11   * 
12   *  The Original Code is pow2toolkit library.
13   * 
14   *  The Initial Owner of the Original Code is 
15   *  Power Of Two S.R.L. (www.pow2.com)
16   *
17   *  Portions created by Power Of Two S.R.L. are 
18   *  Copyright (C) Power Of Two S.R.L.  
19   *  All Rights Reserved.
20   * 
21   * Contributor(s): 
22   */
23  
24  package com.pow2.dao;
25  
26  
27  
28  /***
29   *  Data access object class.
30   *  <br>
31   *  Extends AbstractDAO, and use the singleton
32   *  design pattern to provide an unique object instance
33   *  per vm.
34   *
35   * @author     Luca Fossato
36   * @version    $Id: DAO.java,v 1.1.1.1 2004/08/31 20:22:46 foxat Exp $
37   */
38  public class DAO extends AbstractDAO
39  {
40    /*** an handle to the unique DAO instance. */
41    private static DAO instance = null;
42  
43  
44    /***
45     *  Protected default constructor.
46     *  <br>
47     *  Initialize the data access object properties,
48     *  and load the selected JDBC Driver class.
49     */
50    protected DAO()
51    {
52  	super();
53    }
54  
55  
56    /***
57     *  Get the instance of DAO class.
58     *
59     * @return the instance of DAO class.
60     */
61    public static synchronized DAO instance()
62    {
63      if (instance == null) instance = new DAO();
64      return instance;
65    }
66  }
67