KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > modules > database > IfxSerialAutoIncrementModule


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.cocoon.components.modules.database;
18
19 import java.sql.Connection JavaDoc;
20 import java.sql.SQLException JavaDoc;
21 import java.sql.Statement JavaDoc;
22 import java.util.Map JavaDoc;
23
24 import org.apache.avalon.framework.configuration.Configuration;
25 import org.apache.avalon.framework.configuration.ConfigurationException;
26 import org.apache.avalon.framework.thread.ThreadSafe;
27
28 /**
29  * Abstraction layer to encapsulate different DBMS behaviour for autoincrement columns.
30  *
31  * Here: Informix IUS 9.21 SERIAL columns
32  * (need another one for SERIAL8 ones!)
33  *
34  * @author <a HREF="mailto:haul@apache.org">Christian Haul</a>
35  * @version CVS $Id: IfxSerialAutoIncrementModule.java 30932 2004-07-29 17:35:38Z vgritsenko $
36  */

37 public class IfxSerialAutoIncrementModule implements AutoIncrementModule, ThreadSafe {
38
39     public Object JavaDoc getPostValue( Configuration tableConf, Configuration columnConf, Configuration modeConf,
40                                 Connection JavaDoc conn, Statement JavaDoc stmt, Map JavaDoc objectModel )
41         throws SQLException JavaDoc, ConfigurationException {
42
43         return new Integer JavaDoc(((com.informix.jdbc.IfxStatement) stmt).getSerial());
44     }
45
46
47     public boolean includeInQuery() { return false; }
48
49
50     public boolean includeAsValue() { return false; }
51
52
53     public Object JavaDoc getPreValue( Configuration tableConf, Configuration columnConf, Configuration modeConf,
54                                Connection JavaDoc conn, Map JavaDoc objectModel ) throws SQLException JavaDoc, ConfigurationException {
55
56         return null;
57     }
58
59     public String JavaDoc getSubquery( Configuration tableConf, Configuration columnConf, Configuration modeConf )
60         throws ConfigurationException {
61
62         return null;
63     }
64
65 }
66
Popular Tags