KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > services > sql > StatementFactoryConfiguration


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.services.sql;
19
20 import org.sape.carbon.core.component.ComponentConfiguration;
21 import org.sape.carbon.services.sql.connection.ConnectionFactory;
22
23 /**
24  * <p>This configuration maintains the setup of a
25  * @link{org.sape.carbon.services.sql.StatementFactory} service. It maintains an
26  * array of configured statements that can be generated from the factory as
27  * well as default configurations of many of the statement settings. Each of
28  * these settings are optional and can be overridden in the individual
29  * statement configuration.
30  *
31  * Copyright 2002 Sapient
32  * @since carbon 1.0
33  * @author Vivekanand Kirubanandan, June 2002
34  * @author Greg Hinkle, December 2002
35  * @version $Revision: 1.7 $($Author: dvoet $ / $Date: 2003/05/05 21:21:36 $)
36  */

37  public interface StatementFactoryConfiguration
38         extends ComponentConfiguration {
39
40
41     /**
42      * Retrieves an array of all the sql query configurations.
43      *
44      * @return array of all sql query configurations
45      */

46     StatementConfiguration[] getStatement();
47
48     /**
49      * Sets an array of all the sql query configurations.
50      *
51      * @param statement array of all sql query configurations
52      */

53     void setStatement(StatementConfiguration[] statement);
54
55
56
57     /**
58      * Getter for the connection factory to be used when creating
59      * queries.
60      * @return the default connection factory for this component
61      */

62     ConnectionFactory getConnectionFactory();
63
64     /**
65      * Setter for the connection factory
66      * @param connectionFactory the default connection factory for
67      * this component
68      */

69     void setConnectionFactory(ConnectionFactory connectionFactory);
70
71     /**
72      * Getter for the result set type. As of version 4.2, the now returns
73      * an ResutlSetTypeEnum enumeration.
74      *
75      * @return the default type of result set
76      * @since carbon 1.2
77      */

78     ResultSetTypeEnum getResultSetType();
79
80     /**
81      * Setter for the default type of result set. As of 4.2, the now takes an
82      * ResutlSetTypeEnum enumeration.
83      *
84      * @param resultSetType the type of result set created by default
85      * @see java.sql.ResultSet#TYPE_FORWARD_ONLY
86      * @see java.sql.ResultSet#TYPE_SCROLL_INSENSITIVE
87      * @see java.sql.ResultSet#TYPE_SCROLL_SENSITIVE
88      * @since carbon 1.2
89      */

90     void setResultSetType(ResultSetTypeEnum resultSetType);
91
92
93     /**
94      * Getter for the configured default result set concurrency. As of version
95      * 4.2, this now returns a ResultSetConcurrencyEnum instead of a String.
96      *
97      * @return the default concurrency for this component
98      * @since carbon 1.2
99      */

100     ResultSetConcurrencyEnum getResultSetConcurrency();
101
102     /**
103      * Setter for the concurrency of the result set. As of version 4.2, this
104      * now takes a ResultSetConcurrencyEnum enumeration.
105      *
106      * @param resultSetConcurrency the concurrency type of the result set
107      * @see java.sql.ResultSet#CONCUR_READ_ONLY
108      * @see java.sql.ResultSet#CONCUR_UPDATABLE
109      * @since carbon 1.2
110      */

111     void setResultSetConcurrency(ResultSetConcurrencyEnum resultSetConcurrency);
112
113     /**
114      * Getter for the configured maximum number of rows to return.
115      * @return the maximum number of rows to return.
116      */

117     Integer JavaDoc getMaxRows();
118
119     /**
120      * Setter for the max rows to return.
121      * @param maxRows The maximum number of rows to return from a query.
122      */

123     void setMaxRows(Integer JavaDoc maxRows);
124
125     /**
126      * Getter for the configured fetch size.
127      * @return Gets the configured driver hint for rows to return
128      * at a time.
129      */

130     Integer JavaDoc getFetchSize();
131
132     /**
133      * Setter for the fetch size on results sets.
134      * @param fetchSize A driver hint for the count of records to be returned
135      * on each database message.
136      */

137     void setFetchSize(Integer JavaDoc fetchSize);
138
139     /**
140      * Getter for the maximum field size.
141      * @return the maximum field size in bytes
142      */

143     Integer JavaDoc getMaxFieldSize();
144
145     /**
146      * Setter for the size of fields to be returned.
147      * @param maxFieldSize The max size, in bytes, that the driver should return
148      * for a column.
149      */

150     void setMaxFieldSize(Integer JavaDoc maxFieldSize);
151
152
153     /**
154      * Getter for the configured query timeout.
155      * @return the configured query timeout in milleseconds
156      */

157     Integer JavaDoc getQueryTimeOut();
158
159     /**
160      * Setter for the timeout in milleseconds of this query
161      * @param queryTimeOut the number of milleseconds before the driver should
162      * timeout a database query. (Drivers have defaults)
163      */

164     void setQueryTimeOut(Integer JavaDoc queryTimeOut);
165 }
166
Popular Tags