KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > core > persist > db > BasicDatabaseFactory


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: BasicDatabaseFactory.java,v 1.3 2007/01/07 06:14:18 bastafidli Exp $
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; version 2 of the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */

21
22 package org.opensubsystems.core.persist.db;
23
24 import java.sql.PreparedStatement JavaDoc;
25 import java.sql.SQLException JavaDoc;
26
27 import org.opensubsystems.core.data.DataObject;
28 import org.opensubsystems.core.error.OSSException;
29
30 /**
31  * This interface defines methods, which should be implemented by factory
32  * which support batched insert operation.
33  *
34  * @version $Id: BasicDatabaseFactory.java,v 1.3 2007/01/07 06:14:18 bastafidli Exp $
35  * @author Miro Halas
36  * @code.reviewer Miro Halas
37  * @code.reviewed 1.1 2006/07/26 00:02:45 jlegeny
38  */

39 public interface BasicDatabaseFactory extends DatabaseFactory
40 {
41    /**
42     * Method sets values to the prepared statement for insert of data object.
43     *
44     * @param insertStatement - prepared statement the values will be set up for
45     * @param data - data object to insert, based on the type of the data object
46     * it can be determined what data are we inserting
47     * @param initialIndex - initial index for values to be set up into statement
48     * @return int - index of the last parameter in prepared statement (can be used
49     * for later processing outside of this method)
50     * @throws OSSException - exception during setting values
51     * @throws SQLException - exception during setting values
52     */

53    int setValuesForInsert(
54       PreparedStatement JavaDoc insertStatement,
55       DataObject data,
56       int initialIndex
57    ) throws OSSException,
58             SQLException JavaDoc;
59
60 }
61
Popular Tags