Source Code Cross Referenced for MockParameterMetaData.java in  » Testing » mockrunner-0.4 » com » mockrunner » mock » 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 » Testing » mockrunner 0.4 » com.mockrunner.mock.jdbc 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.mockrunner.mock.jdbc;
002:
003:        import java.sql.ParameterMetaData;
004:        import java.sql.SQLException;
005:        import java.sql.Types;
006:        import java.util.HashMap;
007:        import java.util.Map;
008:
009:        /**
010:         * Mock implementation of <code>ParameterMetaData</code>.
011:         */
012:        public class MockParameterMetaData implements  ParameterMetaData {
013:            private int parameterCount;
014:            private Map parameterModeMap;
015:            private Map parameterTypeMap;
016:            private Map precisionMap;
017:            private Map scaleMap;
018:            private Map isNullableMap;
019:            private Map isSignedMap;
020:            private Map parameterClassNameMap;
021:            private Map parameterTypeNameMap;
022:
023:            public MockParameterMetaData() {
024:                parameterCount = 0;
025:                parameterModeMap = new HashMap();
026:                parameterTypeMap = new HashMap();
027:                precisionMap = new HashMap();
028:                scaleMap = new HashMap();
029:                isNullableMap = new HashMap();
030:                isSignedMap = new HashMap();
031:                parameterClassNameMap = new HashMap();
032:                parameterTypeNameMap = new HashMap();
033:            }
034:
035:            public void setParameterCount(int count) {
036:                parameterCount = count;
037:            }
038:
039:            public void setParameterMode(int param, int parameterMode) {
040:                parameterModeMap.put(new Integer(param), new Integer(
041:                        parameterMode));
042:            }
043:
044:            public void setParameterType(int param, int parameterType) {
045:                parameterTypeMap.put(new Integer(param), new Integer(
046:                        parameterType));
047:            }
048:
049:            public void setPrecision(int param, int precision) {
050:                precisionMap.put(new Integer(param), new Integer(precision));
051:            }
052:
053:            public void setScale(int param, int scale) {
054:                scaleMap.put(new Integer(param), new Integer(scale));
055:            }
056:
057:            public void setNullable(int param, int nullable) {
058:                isNullableMap.put(new Integer(param), new Integer(nullable));
059:            }
060:
061:            public void setSigned(int param, boolean signed) {
062:                isSignedMap.put(new Integer(param), new Boolean(signed));
063:            }
064:
065:            public void setParameterClassName(int param,
066:                    String parameterClassName) {
067:                parameterClassNameMap.put(new Integer(param),
068:                        parameterClassName);
069:            }
070:
071:            public void setParameterTypeName(int param, String parameterTypeName) {
072:                parameterTypeNameMap.put(new Integer(param), parameterTypeName);
073:            }
074:
075:            public int getParameterCount() throws SQLException {
076:                return parameterCount;
077:            }
078:
079:            public int getParameterMode(int param) throws SQLException {
080:                Integer parameterMode = (Integer) parameterModeMap
081:                        .get(new Integer(param));
082:                if (null == parameterMode)
083:                    return parameterModeUnknown;
084:                return parameterMode.intValue();
085:            }
086:
087:            public int getParameterType(int param) throws SQLException {
088:                Integer parameterType = (Integer) parameterTypeMap
089:                        .get(new Integer(param));
090:                if (null == parameterType)
091:                    return Types.OTHER;
092:                return parameterType.intValue();
093:            }
094:
095:            public int getPrecision(int param) throws SQLException {
096:                Integer precision = (Integer) precisionMap.get(new Integer(
097:                        param));
098:                if (null == precision)
099:                    return 0;
100:                return precision.intValue();
101:            }
102:
103:            public int getScale(int param) throws SQLException {
104:                Integer scale = (Integer) scaleMap.get(new Integer(param));
105:                if (null == scale)
106:                    return 0;
107:                return scale.intValue();
108:            }
109:
110:            public int isNullable(int param) throws SQLException {
111:                Integer isNullable = (Integer) isNullableMap.get(new Integer(
112:                        param));
113:                if (null == isNullable)
114:                    return parameterNullable;
115:                return isNullable.intValue();
116:            }
117:
118:            public boolean isSigned(int param) throws SQLException {
119:                Boolean isSigned = (Boolean) isSignedMap
120:                        .get(new Integer(param));
121:                if (null == isSigned)
122:                    return false;
123:                return isSigned.booleanValue();
124:            }
125:
126:            public String getParameterClassName(int param) throws SQLException {
127:                String parameterClassName = (String) parameterClassNameMap
128:                        .get(new Integer(param));
129:                if (null == parameterClassName)
130:                    return Object.class.getName();
131:                return parameterClassName;
132:            }
133:
134:            public String getParameterTypeName(int param) throws SQLException {
135:                String ParameterTypeName = (String) parameterTypeNameMap
136:                        .get(new Integer(param));
137:                if (null == ParameterTypeName)
138:                    return Object.class.getName();
139:                return ParameterTypeName;
140:            }
141:
142:            public boolean isWrapperFor(Class iface) throws SQLException {
143:                return false;
144:            }
145:
146:            public Object unwrap(Class iface) throws SQLException {
147:                throw new SQLException("No object found for " + iface);
148:            }
149:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.