Source Code Cross Referenced for PrepStmt.java in  » IDE-Netbeans » sql.project » org » netbeans » modules » sql » project » dbmodel » 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.sql.project.dbmodel 
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:         *                 Sun Public License Notice
022:         *
023:         * The contents of this file are subject to the Sun Public License
024:         * Version 1.0 (the "License"). You may not use this file except in
025:         * compliance with the License. A copy of the License is available at
026:         * http://www.sun.com/
027:         *
028:         * The Original Code is NetBeans. The Initial Developer of the Original
029:         * Code is Sun Microsystems, Inc. Portions Copyright 1997-2004 Sun
030:         * Microsystems, Inc. All Rights Reserved.
031:         */
032:
033:        package org.netbeans.modules.sql.project.dbmodel;
034:
035:        /**
036:         * Class to hold prepared statement metadata.
037:         *
038:         * @author Susan Chen
039:         * @version 
040:         */
041:        public class PrepStmt {
042:            private String name = ""; // name of prepared statement
043:            private String javaName = ""; // java name of prepared statement
044:            private String catalog = ""; // catalog
045:            private String schema = ""; // schema
046:            private String sqlText = ""; // SQL text
047:            private int numParameters = 0; // number of parameters
048:            private Parameter[] parameters; // array of parameters
049:            private int numResultSetColumns = 0; // number of resultset columns
050:            private ResultSetColumn[] resultsetColumns; // array of resultset columns
051:
052:            /** 
053:             * Creates a new instance of PrepStmt.
054:             */
055:            public PrepStmt() {
056:                name = "";
057:                catalog = "";
058:                schema = "";
059:                sqlText = "";
060:                numParameters = 0;
061:                parameters = null;
062:                numResultSetColumns = 0;
063:                resultsetColumns = null;
064:            }
065:
066:            /**
067:             * Creates a new instance of PrepStmt with the given name.
068:             * @param pname Prepared statement name.
069:             */
070:            public PrepStmt(String pname) {
071:                name = pname;
072:                catalog = "";
073:                schema = "";
074:                sqlText = "";
075:                numParameters = 0;
076:                parameters = null;
077:                numResultSetColumns = 0;
078:                resultsetColumns = null;
079:            }
080:
081:            /**
082:             * Creates a new instance of PrepStmt with the given attributes.
083:             *
084:             * @param pname Prepared statement name
085:             * @param pcatalog Catalog name
086:             * @param pschema Schema name
087:             * @param psqltext Prepared statement SQL text
088:             */
089:            public PrepStmt(String pname, String pcatalog, String pschema,
090:                    String psqltext) {
091:                name = pname;
092:                javaName = "";
093:                catalog = pcatalog;
094:                schema = pschema;
095:                sqlText = psqltext;
096:                numParameters = 0;
097:                parameters = null;
098:                numResultSetColumns = 0;
099:                resultsetColumns = null;
100:            }
101:
102:            /**
103:             * Creates a new instance of PrepStmt with the given attributes.
104:             *
105:             * @param pname Prepared statement name
106:             * @param pname Prepared statement java name
107:             * @param pcatalog Catalog name
108:             * @param pschema Schema name
109:             * @param psqltext Prepared statement SQL text
110:             */
111:            public PrepStmt(String pname, String jname, String pcatalog,
112:                    String pschema, String psqltext) {
113:                name = pname;
114:                javaName = jname;
115:                catalog = pcatalog;
116:                schema = pschema;
117:                sqlText = psqltext;
118:                numParameters = 0;
119:                parameters = null;
120:                numResultSetColumns = 0;
121:                resultsetColumns = null;
122:            }
123:
124:            public PrepStmt(PrepStmt p) {
125:                name = p.getName();
126:                javaName = p.getJavaName();
127:                catalog = p.getCatalog();
128:                schema = p.getSchema();
129:                sqlText = p.getSQLText();
130:                cloneParameters(p.getParameters());
131:                cloneResultSetColumns(p.getResultSetColumns());
132:            }
133:
134:            /**
135:             * Get the prepared statement name.
136:             *
137:             * @return Prepared statement name
138:             */
139:            public String getName() {
140:                return name;
141:            }
142:
143:            /**
144:             * Get the prepared statement java name.
145:             *
146:             * @return Prepared statement java name
147:             */
148:            public String getJavaName() {
149:                return javaName;
150:            }
151:
152:            /**
153:             * Get the catalog name.
154:             *
155:             * @return Catalog name
156:             */
157:            public String getCatalog() {
158:                return catalog;
159:            }
160:
161:            /**
162:             * Get the schema name.
163:             *
164:             * @return Schema name
165:             */
166:            public String getSchema() {
167:                return schema;
168:            }
169:
170:            /**
171:             * Get the Prepared statement SQL text.
172:             *
173:             * @return Prepared statement SQL text.
174:             */
175:            public String getSQLText() {
176:                return sqlText;
177:            }
178:
179:            /**
180:             * Get the number of parameters in the prepared statement.
181:             *
182:             * @return Number of parameters
183:             */
184:            public int getNumParameters() {
185:                return numParameters;
186:            }
187:
188:            /**
189:             * Get the Prepared Statement parameter list.
190:             *
191:             * @return Parameter list
192:             */
193:            public Parameter[] getParameters() {
194:                return parameters;
195:            }
196:
197:            /** 
198:             * Get the number of resultset columns.
199:             *
200:             * @return Number of resultset columns
201:             */
202:            public int getNumResultSetColumns() {
203:                return numResultSetColumns;
204:            }
205:
206:            /**
207:             * Get the Prepared Statement resultset columns list.
208:             *
209:             * @return ResultSet column list
210:             */
211:            public ResultSetColumn[] getResultSetColumns() {
212:                return resultsetColumns;
213:            }
214:
215:            /**
216:             * Set the prepared statement name.
217:             *
218:             * @param newName Prepared statement name
219:             */
220:            public void setName(String newName) {
221:                name = newName;
222:            }
223:
224:            /**
225:             * Set the prepared statement java name.
226:             *
227:             * @param newJavaName Prepared statement java name
228:             */
229:            public void setJavaName(String newJavaName) {
230:                javaName = newJavaName;
231:            }
232:
233:            /**
234:             * Set the catalog name.
235:             *
236:             * @param newCatalog Catalog name
237:             */
238:            public void setCatalog(String newCatalog) {
239:                catalog = newCatalog;
240:            }
241:
242:            /**
243:             * Set the schema name.
244:             *
245:             * @param newSchema Schema name
246:             */
247:            public void setSchema(String newSchema) {
248:                schema = newSchema;
249:            }
250:
251:            /**
252:             * Set the SQL text.
253:             *
254:             * @param newSQLText SQL text
255:             */
256:            public void setSQLText(String newSQLText) {
257:                sqlText = newSQLText;
258:            }
259:
260:            /**
261:             * Set the prepared statement parameter list.
262:             *
263:             * @param newParameters Parameter list
264:             */
265:            public void setParameters(Parameter[] newParameters) {
266:                parameters = newParameters;
267:
268:                // update the number of parameters
269:                if (parameters != null) {
270:                    numParameters = parameters.length;
271:                }
272:            }
273:
274:            public void cloneParameters(Parameter[] newParameters) {
275:                if (newParameters != null) {
276:                    numParameters = newParameters.length;
277:                    if (numParameters > 0) {
278:                        parameters = new Parameter[numParameters];
279:                        for (int i = 0; i < numParameters; i++) {
280:                            parameters[i] = new Parameter(newParameters[i]);
281:                        }
282:                    }
283:                }
284:            }
285:
286:            /**
287:             * Set the prepared statement resultset column list.
288:             *
289:             * @param newResultSetColumns Resultset column list
290:             */
291:            public void setResultSetColumns(
292:                    ResultSetColumn[] newResultSetColumns) {
293:                resultsetColumns = newResultSetColumns;
294:
295:                // update the number of resultset columns
296:                if (resultsetColumns != null) {
297:                    numResultSetColumns = resultsetColumns.length;
298:                }
299:            }
300:
301:            public void cloneResultSetColumns(
302:                    ResultSetColumn[] newResultSetColumns) {
303:                if (newResultSetColumns != null) {
304:                    numResultSetColumns = newResultSetColumns.length;
305:                    if (numResultSetColumns > 0) {
306:                        resultsetColumns = new ResultSetColumn[numResultSetColumns];
307:                        for (int i = 0; i < numResultSetColumns; i++) {
308:                            resultsetColumns[i] = new ResultSetColumn(
309:                                    newResultSetColumns[i]);
310:                        }
311:                    }
312:                }
313:            }
314:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.