View Javadoc

1   package org.apache.torque.adapter;
2   
3   /*
4    * Copyright 2001-2004 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License")
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  import java.sql.Connection;
20  import java.sql.SQLException;
21  
22  /***
23   * This DatabaseHandler is used when you do not have a database
24   * installed.
25   *
26   * @author <a href="mailto:jon@clearink.com">Jon S. Stevens</a>
27   * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
28   * @version $Id: DBNone.java,v 1.7.2.2 2004/05/20 04:35:15 seade Exp $
29   */
30  public class DBNone extends DB
31  {
32  
33      /***
34       * Empty protected constructor.
35       */
36      protected DBNone()
37      {
38      }
39  
40      /***
41       * @return null
42       */
43      public Connection getConnection()
44      {
45          return null;
46      }
47  
48      /***
49       * does nothing.
50       * @deprecated simply remove the call from your code
51       */
52      public void init(String url, String username, String password)
53      {
54      }
55  
56      /***
57       * This method is used to ignore case.
58       *
59       * @param in The string to transform to upper case.
60       * @return The upper case string.
61       */
62      public String toUpperCase(String in)
63      {
64          return in;
65      }
66  
67      /***
68       * This method is used to ignore case.
69       *
70       * @param in The string whose case to ignore.
71       * @return The string in a case that can be ignored.
72       */
73      public String ignoreCase(String in)
74      {
75          return in;
76      }
77  
78      /***
79       * @see org.apache.torque.adapter.DB#getIDMethodType()
80       */
81      public String getIDMethodType()
82      {
83          return NO_ID_METHOD;
84      }
85  
86      /***
87       * @see org.apache.torque.adapter.DB#getIDMethodSQL(Object obj)
88       */
89      public String getIDMethodSQL(Object obj)
90      {
91          return null;
92      }
93  
94      /***
95       * Locks the specified table.
96       *
97       * @param con The JDBC connection to use.
98       * @param table The name of the table to lock.
99       * @exception SQLException No Statement could be created or executed.
100      */
101     public void lockTable(Connection con, String table) throws SQLException
102     {
103     }
104 
105     /***
106      * Unlocks the specified table.
107      *
108      * @param con The JDBC connection to use.
109      * @param table The name of the table to unlock.
110      * @exception SQLException No Statement could be created or executed.
111      */
112     public void unlockTable(Connection con, String table) throws SQLException
113     {
114     }
115 }