Source Code Cross Referenced for ProcEntry.java in  » Database-JDBC-Connection-Pool » jTDS » net » sourceforge » jtds » jdbc » 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 » jTDS » net.sourceforge.jtds.jdbc 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //jTDS JDBC Driver for Microsoft SQL Server and Sybase
002:        //Copyright (C) 2004 The jTDS Project
003:        //
004:        //This library is free software; you can redistribute it and/or
005:        //modify it under the terms of the GNU Lesser General Public
006:        //License as published by the Free Software Foundation; either
007:        //version 2.1 of the License, or (at your option) any later version.
008:        //
009:        //This library is distributed in the hope that it will be useful,
010:        //but WITHOUT ANY WARRANTY; without even the implied warranty of
011:        //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:        //Lesser General Public License for more details.
013:        //
014:        //You should have received a copy of the GNU Lesser General Public
015:        //License along with this library; if not, write to the Free Software
016:        //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:        //
018:        package net.sourceforge.jtds.jdbc;
019:
020:        /**
021:         * Stores information about a cached stored procedure or statement handle.
022:         *
023:         * @version $Id: ProcEntry.java,v 1.1 2005/05/25 09:24:03 alin_sinpalean Exp $
024:         */
025:        public class ProcEntry {
026:            /** The entry references a stored procedure. */
027:            public static final int PROCEDURE = 1;
028:            /** The entry references a prepared statement handle. */
029:            public static final int PREPARE = 2;
030:            /** The entry references a prepared cursor handle. */
031:            public static final int CURSOR = 3;
032:            /** The entry references a failed prepare. */
033:            public static final int PREP_FAILED = 4;
034:
035:            /** Stored procedure name or statement handle. */
036:            private String name;
037:            /** Column meta data (Sybase only). */
038:            private ColInfo[] colMetaData;
039:            /** Parameter meta data (Sybase only). */
040:            private ParamInfo[] paramMetaData;
041:            /** Type of statement referenced by this entry. */
042:            private int type;
043:            /** Usage count for this statement. */
044:            private int refCount;
045:
046:            /**
047:             * Retrieves the procedure or handle name.
048:             *
049:             * @return the statement or handle name as a <code>String</code>
050:             */
051:            public final String toString() {
052:                return name;
053:            }
054:
055:            /**
056:             * Sets the procedure name.
057:             *
058:             * @param name the procedure name
059:             */
060:            public void setName(String name) {
061:                this .name = name;
062:            }
063:
064:            /**
065:             * Sets the prepared statement handle.
066:             *
067:             * @param handle the <code>sp_prepare</code> handle value
068:             */
069:            public void setHandle(int handle) {
070:                this .name = Integer.toString(handle);
071:            }
072:
073:            /**
074:             * Retrieves the column meta data array.
075:             *
076:             * @return the column meta data as <code>ColInfo[]</code>
077:             */
078:            public ColInfo[] getColMetaData() {
079:                return this .colMetaData;
080:            }
081:
082:            /**
083:             * Sets the column meta data.
084:             *
085:             * @param colMetaData the column meta data
086:             */
087:            public void setColMetaData(ColInfo[] colMetaData) {
088:                this .colMetaData = colMetaData;
089:            }
090:
091:            /**
092:             * Retrieves the parameter meta data array.
093:             *
094:             * @return the parameter meta data as a <code>ParamInfo[]</code>
095:             */
096:            public ParamInfo[] getParamMetaData() {
097:                return this .paramMetaData;
098:            }
099:
100:            /**
101:             * Sets the parameter meta data.
102:             *
103:             * @param paramMetaData the parameter meta data array
104:             */
105:            public void setParamMetaData(ParamInfo[] paramMetaData) {
106:                this .paramMetaData = paramMetaData;
107:            }
108:
109:            /**
110:             * Sets the statement implementation type.
111:             *
112:             * @param type the type code (one of PROCEDURE,PREPARE,CURSOR)
113:             */
114:            public void setType(int type) {
115:                this .type = type;
116:            }
117:
118:            /**
119:             * Retrieves the statement implementation type.
120:             *
121:             * @return the statement type as an <code>int</code>
122:             */
123:            public int getType() {
124:                return this .type;
125:            }
126:
127:            /**
128:             * Retrieves the SQL to drop this statement.
129:             */
130:            public void appendDropSQL(StringBuffer sql) {
131:                switch (type) {
132:                case PROCEDURE:
133:                    sql.append("DROP PROC ").append(name).append('\n');
134:                    break;
135:                case PREPARE:
136:                    sql.append("EXEC sp_unprepare ").append(name).append('\n');
137:                    break;
138:                case CURSOR:
139:                    sql.append("EXEC sp_cursorunprepare ").append(name).append(
140:                            '\n');
141:                    break;
142:                case PREP_FAILED:
143:                    break;
144:                default:
145:                    throw new IllegalStateException(
146:                            "Invalid cached statement type " + type);
147:                }
148:            }
149:
150:            /**
151:             * Increments the usage count.
152:             */
153:            public void addRef() {
154:                refCount++;
155:            }
156:
157:            /**
158:             * Decrements the usage count.
159:             */
160:            public void release() {
161:                if (refCount > 0) {
162:                    refCount--;
163:                }
164:            }
165:
166:            /**
167:             * Retreives the usage count.
168:             *
169:             * @return the usage count as an <code>int</code>
170:             */
171:            public int getRefCount() {
172:                return refCount;
173:            }
174:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.