KickJava   Java API By Example, From Geeks To Geeks.

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


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.jdbc.metadata.JdbcField;
15 import com.versant.core.jdbc.metadata.JdbcColumn;
16 import com.versant.core.common.OID;
17
18 import java.sql.ResultSet JavaDoc;
19 import java.sql.SQLException JavaDoc;
20 import java.sql.PreparedStatement JavaDoc;
21
22 /**
23  * JDBC specific methods for OID.
24  */

25 public interface JdbcOID extends OID {
26
27     /**
28      * Populate this OID from the given ResultSet. The firstCol parameter
29      * specifies the column index of the first column to read from rs. If
30      * the primary key consists of multiple columns then they will be
31      * present in the same order as defined in the meta data.
32      *
33      * @return False if OID is 'null', true otherwise
34      */

35     public boolean copyKeyFields(ResultSet JavaDoc rs, int firstCol)
36             throws SQLException JavaDoc;
37
38     public boolean copyKeyFields(ResultSet JavaDoc rs, JdbcField[] pks,
39             int[] pkFieldIndexs) throws SQLException JavaDoc;
40
41     public boolean validateKeyFields(ResultSet JavaDoc rs, int firstCol)
42             throws SQLException JavaDoc;
43
44     /**
45      * Set parameters on a PrepareStatement from this OID. The firstParam
46      * parameter specifies the column index of the first parameter to set.
47      * If the primary key consists of multiple parameters then they must
48      * all be set in the same order as defined in the meta data. The new
49      * firstParam value must be returned i.e. if firstParam started as 3 and
50      * our pk consists of 2 columns then 5 must be returned.
51      */

52     public int setParams(PreparedStatement JavaDoc ps, int firstParam)
53             throws SQLException JavaDoc;
54
55     /**
56      * Set parameters on a PrepareStatement from this OID. Columns in pkc
57      * that return false from isForUpdate() should be ignored.
58      */

59     public int setParams(PreparedStatement JavaDoc ps, int firstParam,
60             JdbcColumn[] pkc) throws SQLException JavaDoc;
61
62 }
63
64
Popular Tags