KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > mapper > dbms > JDBC1Connection


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23 package org.xquark.mapper.dbms;
24
25 import java.sql.*;
26
27 import org.xquark.jdbc.typing.DBMSInfo;
28
29 /**
30  * Base implementation of AbstractConnection for JDBC 1 databases.
31  *
32  * <p>This class is abstract because some methods like table creation
33  * are inevitably specific.</p>
34  */

35 public class JDBC1Connection extends DefaultConnectionImpl
36 {
37     private static final String JavaDoc RCSRevision = "$Revision: 1.2 $";
38     private static final String JavaDoc RCSName = "$Name: $";
39
40
41     public JDBC1Connection(Connection connection, short dbms)
42     throws SQLException
43     {
44         super(connection, dbms);
45     }
46
47     protected JDBC1Connection(Connection connection, short dbms, DBMSInfo dbmsInfo)
48     throws SQLException
49     {
50         super(connection, dbms, dbmsInfo);
51     }
52
53     ///////////////////////////////////////////////////////////////
54
// JDBC1 specific methods
55
///////////////////////////////////////////////////////////////
56
/** Add a SQL statement in a batch for delayed execution.
57      * @param stmt the JDBC statement wich the SQL statement is to be added to
58      */

59     public void addBatch(PreparedStatement stmt) throws SQLException
60     {
61         stmt.executeUpdate();
62     }
63     
64     /** Add a SQL statement in a batch for delayed execution.
65      * @param stmt the JDBC statement which the SQL statement is to be added to
66      * @param SQLStatement the SQL statement that is to be added
67      */

68     public void addBatch(Statement stmt, String JavaDoc SQLStatement) throws SQLException
69     {
70         stmt.executeUpdate(SQLStatement);
71     }
72     
73     /** Execute a batch created with the addBatch method.
74      * @param stmt the JDBC statement wich the SQL statement is to be added to
75      * @return an array of update counts containing one element for each command
76      * in the batch. The elements of the array are ordered according to the
77      * order in which commands were added to the batch.
78      */

79     public int[] executeBatch(Statement stmt) throws SQLException
80     {
81         return null;
82     }
83     
84     /** Gives the JDBC driver a hint as to the number of rows that should be fetched
85      * from the database when more rows are needed.
86      * @param stmt the JDBC statement wich the SQL statement is to be added to
87      * @param rows the number of rows to fetch
88      */

89     public void setFetchSize(Statement stmt,int rows) throws SQLException
90     {
91         // no op
92
}
93 }
94
Popular Tags