Source Code Cross Referenced for NetPreparedStatement.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » client » net » 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 DBMS » db derby 10.2 » org.apache.derby.client.net 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:           Derby - Class org.apache.derby.client.net.NetPreparedStatement
004:
005:           Licensed to the Apache Software Foundation (ASF) under one or more
006:           contributor license agreements.  See the NOTICE file distributed with
007:           this work for additional information regarding copyright ownership.
008:           The ASF licenses this file to You under the Apache License, Version 2.0
009:           (the "License"); you may not use this file except in compliance with
010:           the License.  You may obtain a copy of the License at
011:
012:              http://www.apache.org/licenses/LICENSE-2.0
013:
014:           Unless required by applicable law or agreed to in writing, software
015:           distributed under the License is distributed on an "AS IS" BASIS,
016:           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:           See the License for the specific language governing permissions and
018:           limitations under the License.
019:
020:         */
021:        package org.apache.derby.client.net;
022:
023:        import org.apache.derby.client.am.ColumnMetaData;
024:        import org.apache.derby.client.am.PreparedStatement;
025:        import org.apache.derby.client.am.Section;
026:        import org.apache.derby.client.am.SqlException;
027:        import org.apache.derby.jdbc.ClientDriver;
028:        import org.apache.derby.client.am.ClientJDBCObjectFactory;
029:        import org.apache.derby.client.ClientPooledConnection;
030:
031:        public class NetPreparedStatement extends NetStatement implements 
032:                org.apache.derby.client.am.MaterialPreparedStatement {
033:
034:            // Alias for (NetPreparedStatement) super.statement.
035:            /*final*/
036:            org.apache.derby.client.am.PreparedStatement preparedStatement_;
037:
038:            // Relay constructor for NetCallableStatement.
039:            NetPreparedStatement(
040:                    org.apache.derby.client.am.PreparedStatement statement,
041:                    NetAgent netAgent, NetConnection netConnection) {
042:                super (statement, netAgent, netConnection);
043:                initNetPreparedStatement(statement);
044:            }
045:
046:            void resetNetPreparedStatement(
047:                    org.apache.derby.client.am.PreparedStatement statement,
048:                    NetAgent netAgent, NetConnection netConnection) {
049:                super .resetNetStatement(statement, netAgent, netConnection);
050:                initNetPreparedStatement(statement);
051:            }
052:
053:            private void initNetPreparedStatement(
054:                    org.apache.derby.client.am.PreparedStatement statement) {
055:                preparedStatement_ = statement;
056:                preparedStatement_.materialPreparedStatement_ = this ;
057:            }
058:
059:            /**
060:             *
061:             * The constructor for the NetPreparedStatement class. Called by abstract
062:             * Connection.prepareStatment().newPreparedStatement()
063:             * for jdbc 2 prepared statements with scroll attributes.
064:             * It has the ClientPooledConnection as one of its parameters
065:             * this is used to raise the Statement Events when the prepared
066:             * statement is closed.
067:             *
068:             * @param netAgent The instance of NetAgent associated with this
069:             *              CallableStatement object.
070:             * @param netConnection The connection object associated with this
071:             *                      PreparedStatement Object.
072:             * @param sql         A String object that is the SQL statement
073:             *                    to be sent to the database.
074:             * @param type        One of the ResultSet type constants.
075:             * @param concurrency One of the ResultSet concurrency constants.
076:             * @param holdability One of the ResultSet holdability constants.
077:             * @param autoGeneratedKeys a flag indicating whether auto-generated
078:             *                          keys should be returned.
079:             * @param columnNames A String array of column names indicating
080:             *                    the columns that should be returned
081:             *                    from the inserted row or rows.
082:             * @param cpc The ClientPooledConnection wraps the underlying physical
083:             *            connection associated with this prepared statement
084:             *            it is used to pass the Statement closed and the Statement
085:             *            error occurred events that occur back to the
086:             *            ClientPooledConnection.
087:             * @throws SqlException
088:             *
089:             */
090:            NetPreparedStatement(NetAgent netAgent,
091:                    NetConnection netConnection, String sql, int type,
092:                    int concurrency, int holdability, int autoGeneratedKeys,
093:                    String[] columnNames, ClientPooledConnection cpc)
094:                    throws SqlException {
095:                this (ClientDriver.getFactory().newPreparedStatement(netAgent,
096:                        netConnection, sql, type, concurrency, holdability,
097:                        autoGeneratedKeys, columnNames, cpc), netAgent,
098:                        netConnection);
099:            }
100:
101:            void resetNetPreparedStatement(NetAgent netAgent,
102:                    NetConnection netConnection, String sql, int type,
103:                    int concurrency, int holdability, int autoGeneratedKeys,
104:                    String[] columnNames) throws SqlException {
105:                preparedStatement_.resetPreparedStatement(netAgent,
106:                        netConnection, sql, type, concurrency, holdability,
107:                        autoGeneratedKeys, columnNames);
108:                resetNetPreparedStatement(preparedStatement_, netAgent,
109:                        netConnection);
110:            }
111:
112:            /**
113:             *
114:             * The constructor for the NetPreparedStatement class. For JDBC 3.0 
115:             * positioned updates.It has the ClientPooledConnection as one of 
116:             * its parameters this is used to raise the Statement Events when the 
117:             * prepared statement is closed.
118:             *
119:             * @param netAgent The instance of NetAgent associated with this
120:             *              CallableStatement object.
121:             * @param netConnection The connection object associated with this 
122:             *                      PreparedStatement Object. 
123:             * @param sql           A String object that is the SQL statement to be 
124:             *                      sent to the database.
125:             * @param section
126:             * @param cpc The ClientPooledConnection wraps the underlying physical 
127:             *            connection associated with this prepared statement 
128:             *            it is used to pass the Statement closed and the Statement 
129:             *            error occurred events that occur back to the 
130:             *            ClientPooledConnection
131:             * @throws SqlException
132:             *
133:             */
134:            NetPreparedStatement(NetAgent netAgent,
135:                    NetConnection netConnection, String sql, Section section,
136:                    ClientPooledConnection cpc) throws SqlException {
137:                this (ClientDriver.getFactory().newPreparedStatement(netAgent,
138:                        netConnection, sql, section, cpc), netAgent,
139:                        netConnection);
140:            }
141:
142:            void resetNetPreparedStatement(NetAgent netAgent,
143:                    NetConnection netConnection, String sql, Section section)
144:                    throws SqlException {
145:                preparedStatement_.resetPreparedStatement(netAgent,
146:                        netConnection, sql, section);
147:                resetNetPreparedStatement(preparedStatement_, netAgent,
148:                        netConnection);
149:            }
150:
151:            void resetNetPreparedStatement(NetAgent netAgent,
152:                    NetConnection netConnection, String sql, Section section,
153:                    ColumnMetaData parameterMetaData,
154:                    ColumnMetaData resultSetMetaData) throws SqlException {
155:                preparedStatement_.resetPreparedStatement(netAgent,
156:                        netConnection, sql, section, parameterMetaData,
157:                        resultSetMetaData);
158:                this .resetNetPreparedStatement(preparedStatement_, netAgent,
159:                        netConnection);
160:            }
161:
162:            protected void finalize() throws java.lang.Throwable {
163:                super .finalize();
164:            }
165:
166:            public void writeExecute_(Section section,
167:                    ColumnMetaData parameterMetaData, Object[] inputs,
168:                    int numInputColumns, boolean outputExpected,
169:                    // This is a hint to the material layer that more write commands will follow.
170:                    // It is ignored by the driver in all cases except when blob data is written,
171:                    // in which case this boolean is used to optimize the implementation.
172:                    // Otherwise we wouldn't be able to chain after blob data is sent.
173:                    // If we could always chain a no-op DDM after every execute that writes blobs
174:                    // then we could just always set the chaining flag to on for blob send data
175:                    boolean chainedWritesFollowingSetLob) throws SqlException {
176:                netAgent_.statementRequest_.writeExecute(this , section,
177:                        parameterMetaData, inputs, numInputColumns,
178:                        outputExpected, chainedWritesFollowingSetLob);
179:            }
180:
181:            public void readExecute_() throws SqlException {
182:                netAgent_.statementReply_.readExecute(preparedStatement_);
183:            }
184:
185:            public void writeOpenQuery_(Section section, int fetchSize,
186:                    int resultSetType, int numInputColumns,
187:                    ColumnMetaData parameterMetaData, Object[] inputs)
188:                    throws SqlException {
189:                netAgent_.statementRequest_.writeOpenQuery(this , section,
190:                        fetchSize, resultSetType, numInputColumns,
191:                        parameterMetaData, inputs);
192:            }
193:
194:            // super.readOpenQuery()
195:
196:            public void writeDescribeInput_(Section section)
197:                    throws SqlException {
198:                netAgent_.statementRequest_.writeDescribeInput(this , section);
199:            }
200:
201:            public void readDescribeInput_() throws SqlException {
202:                netAgent_.statementReply_.readDescribeInput(preparedStatement_);
203:            }
204:
205:            public void writeDescribeOutput_(Section section)
206:                    throws SqlException {
207:                netAgent_.statementRequest_.writeDescribeOutput(this , section);
208:            }
209:
210:            public void readDescribeOutput_() throws SqlException {
211:                netAgent_.statementReply_
212:                        .readDescribeOutput(preparedStatement_);
213:            }
214:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.