Source Code Cross Referenced for DBStringFactory.java in  » Content-Management-System » webman » com » teamkonzept » db » 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 » Content Management System » webman » com.teamkonzept.db 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Header: /cvsroot/webman-cms/source/webman/com/teamkonzept/db/DBStringFactory.java,v 1.14 2002/02/16 15:28:34 alex Exp $
003:         *
004:         */
005:        package com.teamkonzept.db;
006:
007:        import org.apache.log4j.Category;
008:
009:        /** 
010:         *	provides databasespecific strings
011:         *
012:         * @author 
013:         * @version 
014:         */
015:        public class DBStringFactory {
016:
017:            /** no default */
018:            private static final String NO_DEFAULT = " NO_DEFAULT ";
019:            private static final String DEFAULT_IS_NULL = " IS NULL ";
020:            private static final String DEFAULT_IS_NOT_NULL = " IS NOT NULL ";
021:            private static final String DEFAULT_NULL_VALUE = " NULL ";
022:            private static final String DEFAULT_TEMP = " ";
023:            private static final String DEFAULT_TRANS = " ";
024:            private static final String DEFAULT_JOIN = " ";
025:            private static final String DEFAULT_FROM = " ";
026:            private static final String DEFAULT_ESCAPE = " ESCAPE '\\' ";
027:            /** wird nur für postgres gebraucht, da postgres casesensitive sortiert */
028:            private static final String DEFAULT_UPPER_ORDER = "";
029:
030:            public static String equalsNull() {
031:                return getDBStringFactory().specEqualsNull();
032:            }
033:
034:            public static String declareAsTemp() {
035:                return getDBStringFactory().specDeclareAsTemp();
036:            }
037:
038:            public static String declareForTransaction() {
039:                return getDBStringFactory().specDeclareForTransaction();
040:            }
041:
042:            public static String notEqualsNull() {
043:                return getDBStringFactory().specNotEqualsNull();
044:            }
045:
046:            public static String nullValue() {
047:                return getDBStringFactory().specNullValue();
048:            }
049:
050:            public static String nvl() {
051:                return getDBStringFactory().specNvl();
052:            }
053:
054:            public static String checkExistence() {
055:                return getDBStringFactory().specCheckExistence();
056:            }
057:
058:            public static String getFromSystem() {
059:                return getDBStringFactory().specGetFromSystem();
060:            }
061:
062:            public static String leftOuterJoin(String leftColumn,
063:                    String rightColumn) {
064:                return getDBStringFactory().specLeftOuterJoin(leftColumn,
065:                        rightColumn);
066:            }
067:
068:            public static String rightOuterJoin(String leftColumn,
069:                    String rightColumn) {
070:                return getDBStringFactory().specRightOuterJoin(leftColumn,
071:                        rightColumn);
072:            }
073:
074:            public static String leftOuterJoinFrom(String[] columns,
075:                    String leftTable, String rightTable) {
076:                return getDBStringFactory().specLeftOuterJoinFrom(columns,
077:                        leftTable, rightTable);
078:            }
079:
080:            public static String rightOuterJoinFrom(String[] columns,
081:                    String leftTable, String rightTable) {
082:                return getDBStringFactory().specRightOuterJoinFrom(columns,
083:                        leftTable, rightTable);
084:            }
085:
086:            /** Escape befehl für like stm. */
087:            public static String escape() {
088:                return getDBStringFactory().specEscape();
089:            }
090:
091:            /** wird nur für postgres gebraucht, da postgres casesensitive sortiert 
092:             @return upperbefehl */
093:            public static String upper_order() {
094:                return getDBStringFactory().specupperorder();
095:            }
096:
097:            public static DBStringFactory getDBStringFactory() {
098:                return getDBStringFactory(TKDBManager.getManager()
099:                        .getConnectionData());
100:            }
101:
102:            public static DBStringFactory getDBStringFactory(
103:                    TKConnectData connectData) {
104:
105:                if (connectData instanceof  TKOracleConnectData) {
106:                    return new OracleStringFactory();
107:                }
108:                if (connectData instanceof  TKSybaseConnectData) {
109:                    return new SybaseStringFactory();
110:                }
111:                if (connectData instanceof  TKPostgreSQLConnectData) {
112:                    return new PostgreSQLStringFactory();
113:                } else {
114:                    return new DBStringFactory();
115:                }
116:            }
117:
118:            public static DBStringFactory getDBStringFactory(
119:                    TKOracleConnectData connectData) {
120:                return new OracleStringFactory();
121:            }
122:
123:            public static DBStringFactory getDBStringFactory(
124:                    TKSybaseConnectData connectData) {
125:                return new SybaseStringFactory();
126:            }
127:
128:            public static DBStringFactory getDBStringFactory(
129:                    TKPostgreSQLConnectData connectData) {
130:                return new PostgreSQLStringFactory();
131:            }
132:
133:            /* defaultimplementations, can be overridden by subclasses */
134:
135:            protected String specNullValue() {
136:                return DEFAULT_NULL_VALUE;
137:            };
138:
139:            /** create a temporary table */
140:            protected String specDeclareAsTemp() {
141:                return DEFAULT_TEMP;
142:            }
143:
144:            /** data in temporary table is persistent for one transaction */
145:            protected String specDeclareForTransaction() {
146:                return DEFAULT_TRANS;
147:            }
148:
149:            /** compare a value to null */
150:            protected String specEqualsNull() {
151:                return DEFAULT_IS_NULL;
152:            }
153:
154:            /** escape */
155:            protected String specEscape() {
156:                return DEFAULT_ESCAPE;
157:            }
158:
159:            /** wird nur für postgres gebraucht, da postgres casesensitive sortiert */
160:            protected String specupperorder() {
161:                return DEFAULT_UPPER_ORDER;
162:            }
163:
164:            protected String specNotEqualsNull() {
165:                return DEFAULT_IS_NOT_NULL;
166:            }
167:
168:            /** if null then...*/
169:            protected String specNvl() {
170:                return NO_DEFAULT;
171:            }
172:
173:            protected String specCheckExistence() {
174:                return NO_DEFAULT;
175:            }
176:
177:            protected String specGetFromSystem() {
178:                return DEFAULT_FROM;
179:            }
180:
181:            /** left outer loin on the given columns */
182:            protected String specLeftOuterJoin(String leftColumn,
183:                    String rightColumn) {
184:                return DEFAULT_JOIN;
185:            }
186:
187:            /** right outer loin on the given columns */
188:            protected String specRightOuterJoin(String leftColumn,
189:                    String rightColumn) {
190:                return DEFAULT_JOIN;
191:            }
192:
193:            /** left outer loin on the given columns */
194:            protected String specLeftOuterJoinFrom(String[] columns,
195:                    String leftTable, String rightTable) {
196:                return DEFAULT_JOIN;
197:            }
198:
199:            /** right outer loin on the given columns */
200:            protected String specRightOuterJoinFrom(String[] columns,
201:                    String leftTable, String rightTable) {
202:                return DEFAULT_JOIN;
203:            }
204:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.