Source Code Cross Referenced for SqlParameter.java in  » Database-Client » LiquiBase » liquibase » database » template » 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 Client » LiquiBase » liquibase.database.template 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package liquibase.database.template;
002:
003:        /**
004:         * Object to represent a SQL parameter definition.
005:         * <p/>
006:         * <p>Parameters may be anonymous, in which case "name" is <code>null</code>.
007:         * However, all parameters must define a SQL type according to {@link java.sql.Types}.
008:         *
009:         * @author Spring Framework
010:         * @see java.sql.Types
011:         */
012:        class SqlParameter {
013:
014:            /**
015:             * The name of the parameter, if any
016:             */
017:            private String name;
018:
019:            /**
020:             * SQL type constant from <code>java.sql.Types</code>
021:             */
022:            private final int sqlType;
023:
024:            /**
025:             * Used for types that are user-named like: STRUCT, DISTINCT, JAVA_OBJECT, named array types
026:             */
027:            private String typeName;
028:
029:            /**
030:             * The scale to apply in case of a NUMERIC or DECIMAL type, if any
031:             */
032:            private Integer scale;
033:
034:            /**
035:             * Create a new anonymous SqlParameter, supplying the SQL type.
036:             *
037:             * @param sqlType SQL type of the parameter according to <code>java.sql.Types</code>
038:             */
039:            public SqlParameter(int sqlType) {
040:                this .sqlType = sqlType;
041:            }
042:
043:            /**
044:             * Create a new anonymous SqlParameter, supplying the SQL type.
045:             *
046:             * @param sqlType  SQL type of the parameter according to <code>java.sql.Types</code>
047:             * @param typeName the type name of the parameter (optional)
048:             */
049:            public SqlParameter(int sqlType, String typeName) {
050:                this .sqlType = sqlType;
051:                this .typeName = typeName;
052:            }
053:
054:            /**
055:             * Create a new anonymous SqlParameter, supplying the SQL type.
056:             *
057:             * @param sqlType SQL type of the parameter according to <code>java.sql.Types</code>
058:             * @param scale   the number of digits after the decimal point
059:             *                (for DECIMAL and NUMERIC types)
060:             */
061:            public SqlParameter(int sqlType, int scale) {
062:                this .sqlType = sqlType;
063:                this .scale = scale;
064:            }
065:
066:            /**
067:             * Create a new SqlParameter, supplying name and SQL type.
068:             *
069:             * @param name    name of the parameter, as used in input and output maps
070:             * @param sqlType SQL type of the parameter according to <code>java.sql.Types</code>
071:             */
072:            public SqlParameter(String name, int sqlType) {
073:                this .name = name;
074:                this .sqlType = sqlType;
075:            }
076:
077:            /**
078:             * Create a new SqlParameter, supplying name and SQL type.
079:             *
080:             * @param name     name of the parameter, as used in input and output maps
081:             * @param sqlType  SQL type of the parameter according to <code>java.sql.Types</code>
082:             * @param typeName the type name of the parameter (optional)
083:             */
084:            public SqlParameter(String name, int sqlType, String typeName) {
085:                this .name = name;
086:                this .sqlType = sqlType;
087:                this .typeName = typeName;
088:            }
089:
090:            /**
091:             * Create a new SqlParameter, supplying name and SQL type.
092:             *
093:             * @param name    name of the parameter, as used in input and output maps
094:             * @param sqlType SQL type of the parameter according to <code>java.sql.Types</code>
095:             * @param scale   the number of digits after the decimal point
096:             *                (for DECIMAL and NUMERIC types)
097:             */
098:            public SqlParameter(String name, int sqlType, int scale) {
099:                this .name = name;
100:                this .sqlType = sqlType;
101:                this .scale = scale;
102:            }
103:
104:            /**
105:             * Copy constructor.
106:             *
107:             * @param otherParam the SqlParameter object to copy from
108:             */
109:            public SqlParameter(SqlParameter otherParam) {
110:                this .name = otherParam.name;
111:                this .sqlType = otherParam.sqlType;
112:                this .typeName = otherParam.typeName;
113:                this .scale = otherParam.scale;
114:            }
115:
116:            /**
117:             * Return the name of the parameter.
118:             */
119:            public String getName() {
120:                return this .name;
121:            }
122:
123:            /**
124:             * Return the SQL type of the parameter.
125:             */
126:            public int getSqlType() {
127:                return this .sqlType;
128:            }
129:
130:            /**
131:             * Return the type name of the parameter, if any.
132:             */
133:            public String getTypeName() {
134:                return this .typeName;
135:            }
136:
137:            /**
138:             * Return the scale of the parameter, if any.
139:             */
140:            public Integer getScale() {
141:                return this .scale;
142:            }
143:
144:            /**
145:             * Return whether this parameter holds input values that should be set
146:             * before execution even if they are <code>null</code>.
147:             * <p>This implementation always returns <code>true</code>.
148:             */
149:            public boolean isInputValueProvided() {
150:                return true;
151:            }
152:
153:            /**
154:             * Return whether this parameter is an implicit return parameter used during the
155:             * reults preocessing of the CallableStatement.getMoreResults/getUpdateCount.
156:             * <p>This implementation always returns <code>false</code>.
157:             */
158:            public boolean isResultsParameter() {
159:                return false;
160:            }
161:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.