Source Code Cross Referenced for PrepStmt.java in  » IDE-Netbeans » sql.project » org » netbeans » modules » jdbcwizard » builder » 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 » IDE Netbeans » sql.project » org.netbeans.modules.jdbcwizard.builder 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the terms of the Common Development
003:         * and Distribution License (the License). You may not use this file except in
004:         * compliance with the License.
005:         * 
006:         * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007:         * or http://www.netbeans.org/cddl.txt.
008:         * 
009:         * When distributing Covered Code, include this CDDL Header Notice in each file
010:         * and include the License file at http://www.netbeans.org/cddl.txt.
011:         * If applicable, add the following below the CDDL Header, with the fields
012:         * enclosed by brackets [] replaced by your own identifying information:
013:         * "Portions Copyrighted [year] [name of copyright owner]"
014:         * 
015:         * The Original Software is NetBeans. The Initial Developer of the Original
016:         * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017:         * Microsystems, Inc. All Rights Reserved.
018:         */
019:
020:        /*
021:         * 
022:         * Copyright 2005 Sun Microsystems, Inc.
023:         * 
024:         * Licensed under the Apache License, Version 2.0 (the "License");
025:         * you may not use this file except in compliance with the License.
026:         * You may obtain a copy of the License at
027:         * 
028:         * 	http://www.apache.org/licenses/LICENSE-2.0
029:         * 
030:         * Unless required by applicable law or agreed to in writing, software
031:         * distributed under the License is distributed on an "AS IS" BASIS,
032:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
033:         * See the License for the specific language governing permissions and
034:         * limitations under the License.
035:         * 
036:         */
037:        package org.netbeans.modules.jdbcwizard.builder;
038:
039:        /**
040:         * Class to hold prepared statement metadata.
041:         * 
042:         * @author
043:         */
044:        public class PrepStmt {
045:            private String name = ""; // name of prepared statement
046:
047:            private String javaName = ""; // java name of prepared statement
048:
049:            private String catalog = ""; // catalog
050:
051:            private String schema = ""; // schema
052:
053:            private String sqlText = ""; // SQL text
054:
055:            private int numParameters = 0; // number of parameters
056:
057:            private Parameter[] parameters; // array of parameters
058:
059:            private int numResultSetColumns = 0; // number of resultset columns
060:
061:            private ResultSetColumn[] resultsetColumns; // array of resultset columns
062:
063:            /**
064:             * Creates a new instance of PrepStmt.
065:             */
066:            public PrepStmt() {
067:                this .name = "";
068:                this .catalog = "";
069:                this .schema = "";
070:                this .sqlText = "";
071:                this .numParameters = 0;
072:                this .parameters = null;
073:                this .numResultSetColumns = 0;
074:                this .resultsetColumns = null;
075:            }
076:
077:            /**
078:             * Creates a new instance of PrepStmt with the given name.
079:             * 
080:             * @param pname Prepared statement name.
081:             */
082:            public PrepStmt(final String pname) {
083:                this .name = pname;
084:                this .catalog = "";
085:                this .schema = "";
086:                this .sqlText = "";
087:                this .numParameters = 0;
088:                this .parameters = null;
089:                this .numResultSetColumns = 0;
090:                this .resultsetColumns = null;
091:            }
092:
093:            /**
094:             * Creates a new instance of PrepStmt with the given attributes.
095:             * 
096:             * @param pname Prepared statement name
097:             * @param pcatalog Catalog name
098:             * @param pschema Schema name
099:             * @param psqltext Prepared statement SQL text
100:             */
101:            public PrepStmt(final String pname, final String pcatalog,
102:                    final String pschema, final String psqltext) {
103:                this .name = pname;
104:                this .javaName = "";
105:                this .catalog = pcatalog;
106:                this .schema = pschema;
107:                this .sqlText = psqltext;
108:                this .numParameters = 0;
109:                this .parameters = null;
110:                this .numResultSetColumns = 0;
111:                this .resultsetColumns = null;
112:            }
113:
114:            /**
115:             * Creates a new instance of PrepStmt with the given attributes.
116:             * 
117:             * @param pname Prepared statement name
118:             * @param pname Prepared statement java name
119:             * @param pcatalog Catalog name
120:             * @param pschema Schema name
121:             * @param psqltext Prepared statement SQL text
122:             */
123:            public PrepStmt(final String pname, final String jname,
124:                    final String pcatalog, final String pschema,
125:                    final String psqltext) {
126:                this .name = pname;
127:                this .javaName = jname;
128:                this .catalog = pcatalog;
129:                this .schema = pschema;
130:                this .sqlText = psqltext;
131:                this .numParameters = 0;
132:                this .parameters = null;
133:                this .numResultSetColumns = 0;
134:                this .resultsetColumns = null;
135:            }
136:
137:            public PrepStmt(final PrepStmt p) {
138:                this .name = p.getName();
139:                this .javaName = p.getJavaName();
140:                this .catalog = p.getCatalog();
141:                this .schema = p.getSchema();
142:                this .sqlText = p.getSQLText();
143:                this .cloneParameters(p.getParameters());
144:                this .cloneResultSetColumns(p.getResultSetColumns());
145:            }
146:
147:            /**
148:             * Get the prepared statement name.
149:             * 
150:             * @return Prepared statement name
151:             */
152:            public String getName() {
153:                return this .name;
154:            }
155:
156:            /**
157:             * Get the prepared statement java name.
158:             * 
159:             * @return Prepared statement java name
160:             */
161:            public String getJavaName() {
162:                return this .javaName;
163:            }
164:
165:            /**
166:             * Get the catalog name.
167:             * 
168:             * @return Catalog name
169:             */
170:            public String getCatalog() {
171:                return this .catalog;
172:            }
173:
174:            /**
175:             * Get the schema name.
176:             * 
177:             * @return Schema name
178:             */
179:            public String getSchema() {
180:                return this .schema;
181:            }
182:
183:            /**
184:             * Get the Prepared statement SQL text.
185:             * 
186:             * @return Prepared statement SQL text.
187:             */
188:            public String getSQLText() {
189:                return this .sqlText;
190:            }
191:
192:            /**
193:             * Get the number of parameters in the prepared statement.
194:             * 
195:             * @return Number of parameters
196:             */
197:            public int getNumParameters() {
198:                return this .numParameters;
199:            }
200:
201:            /**
202:             * Get the Prepared Statement parameter list.
203:             * 
204:             * @return Parameter list
205:             */
206:            public Parameter[] getParameters() {
207:                return this .parameters;
208:            }
209:
210:            /**
211:             * Get the number of resultset columns.
212:             * 
213:             * @return Number of resultset columns
214:             */
215:            public int getNumResultSetColumns() {
216:                return this .numResultSetColumns;
217:            }
218:
219:            /**
220:             * Get the Prepared Statement resultset columns list.
221:             * 
222:             * @return ResultSet column list
223:             */
224:            public ResultSetColumn[] getResultSetColumns() {
225:                return this .resultsetColumns;
226:            }
227:
228:            /**
229:             * Set the prepared statement name.
230:             * 
231:             * @param newName Prepared statement name
232:             */
233:            public void setName(final String newName) {
234:                this .name = newName;
235:            }
236:
237:            /**
238:             * Set the prepared statement java name.
239:             * 
240:             * @param newJavaName Prepared statement java name
241:             */
242:            public void setJavaName(final String newJavaName) {
243:                this .javaName = newJavaName;
244:            }
245:
246:            /**
247:             * Set the catalog name.
248:             * 
249:             * @param newCatalog Catalog name
250:             */
251:            public void setCatalog(final String newCatalog) {
252:                this .catalog = newCatalog;
253:            }
254:
255:            /**
256:             * Set the schema name.
257:             * 
258:             * @param newSchema Schema name
259:             */
260:            public void setSchema(final String newSchema) {
261:                this .schema = newSchema;
262:            }
263:
264:            /**
265:             * Set the SQL text.
266:             * 
267:             * @param newSQLText SQL text
268:             */
269:            public void setSQLText(final String newSQLText) {
270:                this .sqlText = newSQLText;
271:            }
272:
273:            /**
274:             * Set the prepared statement parameter list.
275:             * 
276:             * @param newParameters Parameter list
277:             */
278:            public void setParameters(final Parameter[] newParameters) {
279:                this .parameters = newParameters;
280:
281:                // update the number of parameters
282:                if (this .parameters != null) {
283:                    this .numParameters = this .parameters.length;
284:                }
285:            }
286:
287:            public void cloneParameters(final Parameter[] newParameters) {
288:                if (newParameters != null) {
289:                    this .numParameters = newParameters.length;
290:                    if (this .numParameters > 0) {
291:                        this .parameters = new Parameter[this .numParameters];
292:                        for (int i = 0; i < this .numParameters; i++) {
293:                            this .parameters[i] = new Parameter(newParameters[i]);
294:                        }
295:                    }
296:                }
297:            }
298:
299:            /**
300:             * Set the prepared statement resultset column list.
301:             * 
302:             * @param newResultSetColumns Resultset column list
303:             */
304:            public void setResultSetColumns(
305:                    final ResultSetColumn[] newResultSetColumns) {
306:                this .resultsetColumns = newResultSetColumns;
307:
308:                // update the number of resultset columns
309:                if (this .resultsetColumns != null) {
310:                    this .numResultSetColumns = this .resultsetColumns.length;
311:                }
312:            }
313:
314:            public void cloneResultSetColumns(
315:                    final ResultSetColumn[] newResultSetColumns) {
316:                if (newResultSetColumns != null) {
317:                    this .numResultSetColumns = newResultSetColumns.length;
318:                    if (this .numResultSetColumns > 0) {
319:                        this .resultsetColumns = new ResultSetColumn[this .numResultSetColumns];
320:                        for (int i = 0; i < this .numResultSetColumns; i++) {
321:                            this .resultsetColumns[i] = new ResultSetColumn(
322:                                    newResultSetColumns[i]);
323:                        }
324:                    }
325:                }
326:            }
327:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.