KickJava   Java API By Example, From Geeks To Geeks.

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


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.config.Configuration;
21 import org.sape.carbon.services.sql.connection.ConnectionFactory;
22
23 /**
24  * <p>This configuration holds the definition of a specific SQL statement. It
25  * maintains the parameters that are configurable on java.sql.Statement objects
26  * and their subclasses in order to allow configurable modification of their
27  * use with the Statement Factory.</p>
28  *
29  * Copyright 2002 Sapient
30  * @since carbon 1.0
31  * @author Vivekanand Kirubanandan, June 2002
32  * @author Greg Hinkle, December 2002
33  * @version $Revision: 1.6 $($Author: dvoet $ / $Date: 2003/05/05 21:21:36 $)
34
35  */

36 public interface StatementConfiguration extends Configuration {
37
38     /**
39      * Getter for the name of the query
40      * @return the name of the query
41      */

42     String JavaDoc getQueryName();
43
44     /**
45      * Setter for the query name
46      * @param queryName the name of the query
47      */

48     void setQueryName(String JavaDoc queryName);
49
50     /**
51      * The getter for the sql code of this query
52      * @return the sql query code
53      */

54     String JavaDoc getQuery();
55
56     /**
57      * Setter for the sql query
58      * @param query the sql of this query
59      */

60     void setQuery(String JavaDoc query);
61
62     /**
63      * Getter for the connection factory to be used when creating
64      * queries.
65      * @return the specific connection factory for this query
66      */

67     ConnectionFactory getConnectionFactory();
68
69     /**
70      * Setter for the connection factory
71      * @param connectionFactory the default connection factory for this query
72      */

73     void setConnectionFactory(ConnectionFactory connectionFactory);
74
75     /**
76      * Getter for the result set type
77      * @return the default type of result set
78      */

79     ResultSetTypeEnum getResultSetType();
80
81     /**
82      * Setter for the default type of result set.
83      * @param resultSetType the type of result set created
84      * @see java.sql.ResultSet#TYPE_FORWARD_ONLY
85      * @see java.sql.ResultSet#TYPE_SCROLL_INSENSITIVE
86      * @see java.sql.ResultSet#TYPE_SCROLL_SENSITIVE
87      */

88     void setResultSetType(ResultSetTypeEnum resultSetType);
89
90
91     /**
92      * Getter for the configured query's result set concurrency.
93      * @return the default concurrency for this query
94      */

95     ResultSetConcurrencyEnum getResultSetConcurrency();
96
97     /**
98      * Setter for the concurrency of the result set.
99      * @param resultSetConcurrency the concurrency type of the result set
100      * @see java.sql.ResultSet#CONCUR_READ_ONLY
101      * @see java.sql.ResultSet#CONCUR_UPDATABLE
102      */

103     void setResultSetConcurrency(ResultSetConcurrencyEnum resultSetConcurrency);
104
105     /**
106      * Getter for the configured maximum number of rows to return.
107      * @return the maximum number of rows to return.
108      */

109     Integer JavaDoc getMaxRows();
110
111     /**
112      * Setter for the max rows to return.
113      * @param maxRows The maximum number of rows to return from a query.
114      */

115     void setMaxRows(Integer JavaDoc maxRows);
116
117     /**
118      * Getter for the configured fetch size.
119      * @return Gets the configured driver hint for rows to return
120      * at a time.
121      */

122     Integer JavaDoc getFetchSize();
123
124     /**
125      * Setter for the fetch size on results sets.
126      * @param fetchSize A driver hint for the count of records to be returned
127      * on each database message.
128      */

129     void setFetchSize(Integer JavaDoc fetchSize);
130
131     /**
132      * Getter for the maximum field size.
133      * @return the maximum field size in bytes
134      */

135     Integer JavaDoc getMaxFieldSize();
136
137     /**
138      * Setter for the size of fields to be returned.
139      * @param maxFieldSize The max size, in bytes, that the driver should return
140      * for a column.
141      */

142     void setMaxFieldSize(Integer JavaDoc maxFieldSize);
143
144
145     /**
146      * Getter for the configured query timeout.
147      * @return the configured query timeout in milleseconds
148      */

149     Integer JavaDoc getQueryTimeOut();
150
151     /**
152      * Setter for the timeout in milleseconds of this query
153      * @param queryTimeOut the number of milleseconds before the driver should
154      * timeout a database query. (Drivers have defaults)
155      */

156     void setQueryTimeOut(Integer JavaDoc queryTimeOut);
157 }
Popular Tags