Source Code Cross Referenced for NetPackageReply.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.NetPackageReply
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:
022:        package org.apache.derby.client.net;
023:
024:        import org.apache.derby.client.am.DisconnectException;
025:        import org.apache.derby.client.am.ClientMessageId;
026:        import org.apache.derby.shared.common.reference.SQLState;
027:
028:        public class NetPackageReply extends NetConnectionReply {
029:            NetPackageReply(NetAgent netAgent, int bufferSize) {
030:                super (netAgent, bufferSize);
031:            }
032:
033:            NetSqlca parseSqlErrorCondition() throws DisconnectException {
034:                parseSQLERRRM();
035:                parseTypdefsOrMgrlvlovrs();
036:                NetSqlca netSqlca = parseSQLCARD(null);
037:                return netSqlca;
038:            }
039:
040:            // Also called by NetStatementReply
041:            void parseDTAMCHRM() throws DisconnectException {
042:                boolean svrcodReceived = false;
043:                int svrcod = CodePoint.SVRCOD_INFO;
044:                boolean rdbnamReceived = false;
045:                String rdbnam = null;
046:
047:                parseLengthAndMatchCodePoint(CodePoint.DTAMCHRM);
048:                pushLengthOnCollectionStack();
049:                int peekCP = peekCodePoint();
050:
051:                while (peekCP != Reply.END_OF_COLLECTION) {
052:
053:                    boolean foundInPass = false;
054:
055:                    if (peekCP == CodePoint.SVRCOD) {
056:                        foundInPass = true;
057:                        svrcodReceived = checkAndGetReceivedFlag(svrcodReceived);
058:                        svrcod = parseSVRCOD(CodePoint.SVRCOD_ERROR,
059:                                CodePoint.SVRCOD_ERROR);
060:                        peekCP = peekCodePoint();
061:                    }
062:
063:                    if (peekCP == CodePoint.RDBNAM) {
064:                        foundInPass = true;
065:                        rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived);
066:                        rdbnam = parseRDBNAM(true);
067:                        peekCP = peekCodePoint();
068:                    }
069:
070:                    if (!foundInPass) {
071:                        doPrmnsprmSemantics(peekCP);
072:                    }
073:
074:                }
075:                popCollectionStack();
076:                checkRequiredObjects(svrcodReceived, rdbnamReceived);
077:
078:                netAgent_.setSvrcod(svrcod);
079:                doDtamchrmSemantics();
080:            }
081:
082:            // RDB Update Reply Message indicates that a DDM command resulted
083:            // in an update at the target relational database.  If a command
084:            // generated multiple reply messages including an RDBUPDRM, then
085:            // the RDBUPDRM must be the first reply message for the command.
086:            // For each target server, the RDBUPDRM  must be returned the first
087:            // time an update is made to the target RDB within a unit of work.
088:            // The target server may optionally return the RDBUPDRM after subsequent
089:            // updates within the UOW.  If multiple target RDBs are involved with
090:            // the current UOW and updates are made with any of them, then the RDBUPDRM
091:            // must be returned in response to the first update at each of them.
092:            protected void parseRDBUPDRM() throws DisconnectException {
093:                boolean svrcodReceived = false;
094:                int svrcod = CodePoint.SVRCOD_INFO;
095:                boolean rdbnamReceived = false;
096:                String rdbnam = null;
097:
098:                parseLengthAndMatchCodePoint(CodePoint.RDBUPDRM);
099:                pushLengthOnCollectionStack();
100:
101:                // in XA Global transaction we need to know if we have a read-only
102:                //  transaction, if we get a RDBUPDRM this is NOT a read-only transaction
103:                //  currently only XAConnections care about read-only transactions, if
104:                //  non-XA wants this information they will need to initialize the flag
105:                //  at start of UOW
106:                netAgent_.netConnection_.setReadOnlyTransactionFlag(false);
107:
108:                int peekCP = peekCodePoint();
109:
110:                while (peekCP != Reply.END_OF_COLLECTION) {
111:
112:                    boolean foundInPass = false;
113:
114:                    if (peekCP == CodePoint.SVRCOD) {
115:                        foundInPass = true;
116:                        svrcodReceived = checkAndGetReceivedFlag(svrcodReceived);
117:                        svrcod = parseSVRCOD(CodePoint.SVRCOD_INFO,
118:                                CodePoint.SVRCOD_INFO);
119:                        peekCP = peekCodePoint();
120:                    }
121:
122:                    if (peekCP == CodePoint.RDBNAM) {
123:                        foundInPass = true;
124:                        rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived);
125:                        rdbnam = parseRDBNAM(true);
126:                        peekCP = peekCodePoint();
127:                    }
128:
129:                    if (!foundInPass) {
130:                        doPrmnsprmSemantics(peekCP);
131:                    }
132:
133:                }
134:                popCollectionStack();
135:                checkRequiredObjects(svrcodReceived, rdbnamReceived);
136:
137:                // call an event to indicate the server has been updated
138:                netAgent_.setSvrcod(svrcod);
139:
140:            }
141:
142:            // SQL Error Condition Reply Message indicates that an SQL error
143:            // has occurred.  It may be sent even though no reply message
144:            // precedes the SQLCARD object that is the normal
145:            // response to a command when an exception occurs.
146:            // The SQLERRM is also used when a BNDSQLSTT command is terminated
147:            // by an INTRRDBRQS command.
148:            // This reply message must precede an SQLCARD object.
149:            // The SQLSTATE is returned in the SQLCARD.
150:            //
151:            // Returned from Server:
152:            // SVRCOD - required  (8 - ERROR)
153:            // RDBNAM - optional
154:            //
155:            // Also called by NetResultSetReply and NetStatementReply
156:            void parseSQLERRRM() throws DisconnectException {
157:                boolean svrcodReceived = false;
158:                int svrcod = CodePoint.SVRCOD_INFO;
159:                boolean rdbnamReceived = false;
160:                String rdbnam = null;
161:
162:                parseLengthAndMatchCodePoint(CodePoint.SQLERRRM);
163:                pushLengthOnCollectionStack();
164:                int peekCP = peekCodePoint();
165:
166:                while (peekCP != Reply.END_OF_COLLECTION) {
167:
168:                    boolean foundInPass = false;
169:
170:                    if (peekCP == CodePoint.SVRCOD) {
171:                        foundInPass = true;
172:                        svrcodReceived = checkAndGetReceivedFlag(svrcodReceived);
173:                        svrcod = parseSVRCOD(CodePoint.SVRCOD_ERROR,
174:                                CodePoint.SVRCOD_ERROR);
175:                        peekCP = peekCodePoint();
176:                    }
177:
178:                    if (peekCP == CodePoint.RDBNAM) {
179:                        foundInPass = true;
180:                        rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived);
181:                        rdbnam = parseRDBNAM(true);
182:                        peekCP = peekCodePoint();
183:                    }
184:
185:                    if (!foundInPass) {
186:                        doPrmnsprmSemantics(peekCP);
187:                    }
188:
189:                }
190:                popCollectionStack();
191:                checkRequiredObjects(svrcodReceived);
192:
193:                // move into a method
194:                netAgent_.setSvrcod(svrcod);
195:            }
196:
197:            //--------------------- parse DDM Reply Data--------------------------------------
198:
199:            //------------------------parse DDM Scalars-----------------------------
200:
201:            // RDB Package Name and Consistency token Scalar Object specifies the
202:            // fully qualified name of a relational database package and its
203:            // consistency token.
204:            protected Object parsePKGNAMCT(boolean skip)
205:                    throws DisconnectException {
206:                parseLengthAndMatchCodePoint(CodePoint.PKGNAMCT);
207:                if (skip) {
208:                    skipBytes();
209:                    return null;
210:                }
211:                agent_
212:                        .accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(
213:                                agent_, new ClientMessageId(
214:                                        SQLState.DRDA_COMMAND_NOT_IMPLEMENTED),
215:                                "parsePKGNAMCT"));
216:                return null; // to make compiler happy
217:            }
218:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.