Source Code Cross Referenced for RequestWithResultSetParameters.java in  » Database-JDBC-Connection-Pool » sequoia-2.10.9 » org » continuent » sequoia » common » sql » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database JDBC Connection Pool » sequoia 2.10.9 » org.continuent.sequoia.common.sql 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Sequoia: Database clustering technology.
003:         * Copyright (C) 2005 Continuent, Inc.
004:         * Contact: sequoia@continuent.org
005:         * 
006:         * Licensed under the Apache License, Version 2.0 (the "License");
007:         * you may not use this file except in compliance with the License.
008:         * You may obtain a copy of the License at
009:         * 
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         * 
012:         * Unless required by applicable law or agreed to in writing, software
013:         * distributed under the License is distributed on an "AS IS" BASIS,
014:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:         * See the License for the specific language governing permissions and
016:         * limitations under the License. 
017:         *
018:         * Initial developer(s): Emmanuel Cecchet.
019:         * Contributor(s): ______________________.
020:         */package org.continuent.sequoia.common.sql;
021:
022:        import java.io.IOException;
023:
024:        import org.continuent.sequoia.common.stream.DriverBufferedInputStream;
025:        import org.continuent.sequoia.common.stream.DriverBufferedOutputStream;
026:
027:        /**
028:         * This class defines a Request with additional parameters indicating how the
029:         * ResulSet should be fetched. This is only useful for calls to
030:         * Statement.executeQuery() or Statement.execute() when ResultSets are returned.
031:         * 
032:         * @author <a href="mailto:emmanuel.cecchet@continuent.com">Emmanuel Cecchet</a>
033:         * @version 1.0
034:         */
035:        public class RequestWithResultSetParameters extends Request {
036:
037:            /*
038:             * ResultSet Parameters
039:             */
040:            private int maxRows = 0;
041:            private int fetchSize = 0;
042:            private String cursorName = null;
043:
044:            //
045:            // Constructors
046:            //
047:
048:            /**
049:             * Creates a new <code>RequestWithResultSetParameters</code> object
050:             * @param sqlTemplate the SQL template (using ? as parameter placeholders) or
051:             *          null
052:             * @param parameters the SQL statement
053:             * @param escapeProcessing Should the backend driver do escape processing
054:             *          before sending to the database?
055:             * @param timeoutInSeconds Timeout for this request in seconds, value 0 means
056:             *          no timeout
057:             */
058:            public RequestWithResultSetParameters(String sqlTemplate,
059:                    String parameters, boolean escapeProcessing,
060:                    int timeoutInSeconds) {
061:                super (sqlTemplate, parameters, escapeProcessing,
062:                        timeoutInSeconds);
063:            }
064:
065:            //
066:            // Serialization methods
067:            //
068:
069:            /**
070:             * Creates a new <code>RequestWithResultSetParameters</code> object,
071:             * deserializing it from an input stream. Has to mirror the serialization
072:             * method below.
073:             * 
074:             * @param in input stream
075:             * @throws IOException stream error
076:             */
077:            public RequestWithResultSetParameters(DriverBufferedInputStream in)
078:                    throws IOException {
079:                super (in);
080:                this .maxRows = in.readInt();
081:                this .fetchSize = in.readInt();
082:
083:                if (in.readBoolean()) // do we have a cursor name ?
084:                    this .cursorName = in.readLongUTF();
085:            }
086:
087:            /**
088:             * Also serialize ResultSet parameters to the stream. Optionally used by
089:             * serializers of those derived requests that expect a ResultSet.
090:             * 
091:             * @see org.continuent.sequoia.common.sql.Request#sendToStream(org.continuent.sequoia.common.stream.DriverBufferedOutputStream)
092:             */
093:            public void sendToStream(DriverBufferedOutputStream out)
094:                    throws IOException {
095:                super .sendToStream(out);
096:
097:                out.writeInt(maxRows);
098:                out.writeInt(fetchSize);
099:
100:                if (this .cursorName != null) // do we have a cursor name ?
101:                {
102:                    out.writeBoolean(true);
103:                    out.writeLongUTF(cursorName);
104:                } else
105:                    out.writeBoolean(false);
106:            }
107:
108:            //
109:            // Getter/Setter
110:            //
111:
112:            /**
113:             * Returns the cursorName value.
114:             * 
115:             * @return Returns the cursorName.
116:             */
117:            public final String getCursorName() {
118:                return cursorName;
119:            }
120:
121:            /**
122:             * Sets the cursorName value.
123:             * 
124:             * @param cursorName The cursorName to set.
125:             */
126:            public final void setCursorName(String cursorName) {
127:                this .cursorName = cursorName;
128:            }
129:
130:            /**
131:             * Returns the fetchSize value.
132:             * 
133:             * @return Returns the fetchSize.
134:             */
135:            public final int getFetchSize() {
136:                return fetchSize;
137:            }
138:
139:            /**
140:             * Sets the fetchSize value.
141:             * 
142:             * @param fetchSize The fetchSize to set.
143:             */
144:            public final void setFetchSize(int fetchSize) {
145:                this .fetchSize = fetchSize;
146:            }
147:
148:            /**
149:             * Returns the maxRows value.
150:             * 
151:             * @return Returns the maxRows.
152:             */
153:            public final int getMaxRows() {
154:                return maxRows;
155:            }
156:
157:            /**
158:             * Sets the maxRows value.
159:             * 
160:             * @param maxRows The maxRows to set.
161:             */
162:            public final void setMaxRows(int maxRows) {
163:                this.maxRows = maxRows;
164:            }
165:
166:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.