KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > jdbc > JdbcNewObjectOID


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.jdbc;
13
14 import com.versant.core.common.NewObjectOID;
15 import com.versant.core.metadata.ClassMetaData;
16 import com.versant.core.jdbc.metadata.JdbcField;
17 import com.versant.core.jdbc.metadata.JdbcColumn;
18
19 import java.sql.ResultSet JavaDoc;
20 import java.sql.SQLException JavaDoc;
21 import java.sql.PreparedStatement JavaDoc;
22
23 /**
24  * Adds JDBC specific methods that pass through to the real OID. This saves
25  * having to call getRealOID() before casting to JdbcOID in a lot of the JDBC
26  * code.
27  */

28 public final class JdbcNewObjectOID extends NewObjectOID implements JdbcOID {
29
30     public JdbcNewObjectOID() {
31     }
32
33     public JdbcNewObjectOID(ClassMetaData cmd) {
34         super(cmd);
35     }
36
37     public NewObjectOID newInstance(ClassMetaData cmd) {
38         return new JdbcNewObjectOID(cmd);
39     }
40
41     public boolean copyKeyFields(ResultSet JavaDoc rs, int firstCol)
42             throws SQLException JavaDoc {
43         return ((JdbcOID)realOID).copyKeyFields(rs, firstCol);
44     }
45
46     public boolean copyKeyFields(ResultSet JavaDoc rs, JdbcField[] pks,
47             int[] pkFieldIndexs) throws SQLException JavaDoc {
48         return ((JdbcOID)realOID).copyKeyFields(rs, pks, pkFieldIndexs);
49     }
50
51     public boolean validateKeyFields(ResultSet JavaDoc rs, int firstCol)
52             throws SQLException JavaDoc {
53         return ((JdbcOID)realOID).validateKeyFields(rs, firstCol);
54     }
55
56     public int setParams(PreparedStatement JavaDoc ps, int firstParam)
57             throws SQLException JavaDoc {
58         return ((JdbcOID)realOID).setParams(ps, firstParam);
59     }
60
61     public int setParams(PreparedStatement JavaDoc ps, int firstParam,
62             JdbcColumn[] pkc) throws SQLException JavaDoc {
63         return ((JdbcOID)realOID).setParams(ps, firstParam, pkc);
64     }
65
66 }
67
68
Popular Tags