Source Code Cross Referenced for PlatformMckoiImpl.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » apache » ojb » broker » platforms » 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 » ERP CRM Financial » Kuali Financial System » org.apache.ojb.broker.platforms 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2007 The Kuali Foundation
003:         *
004:         * Licensed under the Educational Community License, Version 1.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         * http://www.opensource.org/licenses/ecl1.php
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        /* Created on Sep 13, 2005 */
017:        package org.apache.ojb.broker.platforms;
018:
019:        /* Copyright 2002-2004 The Apache Software Foundation
020:         *
021:         * Licensed under the Apache License, Version 2.0 (the "License");
022:         * you may not use this file except in compliance with the License.
023:         * You may obtain a copy of the License at
024:         *
025:         *     http://www.apache.org/licenses/LICENSE-2.0
026:         *
027:         * Unless required by applicable law or agreed to in writing, software
028:         * distributed under the License is distributed on an "AS IS" BASIS,
029:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
030:         * See the License for the specific language governing permissions and
031:         * limitations under the License.
032:         */
033:
034:        import java.io.ByteArrayInputStream;
035:        import java.io.InputStreamReader;
036:        import java.io.Reader;
037:        import java.io.StringReader;
038:        import java.sql.PreparedStatement;
039:        import java.sql.SQLException;
040:        import java.sql.Types;
041:
042:        import org.apache.ojb.broker.query.LikeCriteria;
043:
044:        /**
045:         * Platform implementation for the Mckoi database.
046:         * 
047:         * @version 1.0
048:         * @author Kuali Rice Team (kuali-rice@googlegroups.com)
049:         * @version $Id: PlatformMckoiImpl.java,v 1.2.16.1.6.1 2007/10/17 20:32:06 agodert Exp $
050:         * @see http://www.mckoi.com/database
051:         */
052:        public class PlatformMckoiImpl extends PlatformDefaultImpl {
053:            /* (non-Javadoc)
054:             * @see Platform#setObjectForStatement(PreparedStatement, int, Object, int)
055:             */
056:            public void setObjectForStatement(PreparedStatement statement,
057:                    int index, Object value, int sqlType) throws SQLException {
058:                switch (sqlType) {
059:                case Types.BLOB:
060:                case Types.LONGVARBINARY:
061:                case Types.VARBINARY:
062:                    if (value instanceof  byte[]) {
063:                        byte[] buf = (byte[]) value;
064:                        ByteArrayInputStream inputStream = new ByteArrayInputStream(
065:                                buf);
066:                        statement.setBinaryStream(index, inputStream,
067:                                buf.length);
068:
069:                        break;
070:                    }
071:
072:                case Types.CLOB:
073:                    Reader reader = null;
074:                    int length = 0;
075:
076:                    if (value instanceof  String) {
077:                        reader = new StringReader((String) value);
078:                        length = (((String) value)).length();
079:                    } else if (value instanceof  char[]) {
080:                        String string = new String((char[]) value);
081:
082:                        reader = new StringReader(string);
083:                        length = string.length();
084:                    } else if (value instanceof  byte[]) {
085:                        ByteArrayInputStream inputStream = new ByteArrayInputStream(
086:                                (byte[]) value);
087:
088:                        reader = new InputStreamReader(inputStream);
089:                    }
090:                    statement.setCharacterStream(index, reader, length);
091:                    break;
092:
093:                default:
094:                    super .setObjectForStatement(statement, index, value,
095:                            sqlType);
096:
097:                }
098:            }
099:
100:            /* (non-Javadoc)
101:             * @see org.apache.ojb.broker.platforms.Platform#createSequenceQuery(String)
102:             */
103:            public String createSequenceQuery(String sequenceName) {
104:                return "create sequence " + sequenceName;
105:            }
106:
107:            /* (non-Javadoc)
108:             * @see org.apache.ojb.broker.platforms.Platform#nextSequenceQuery(String)
109:             */
110:            public String nextSequenceQuery(String sequenceName) {
111:                return "select nextval('" + sequenceName + "')";
112:            }
113:
114:            /* (non-Javadoc)
115:             * @see org.apache.ojb.broker.platforms.Platform#dropSequenceQuery(String)
116:             */
117:            public String dropSequenceQuery(String sequenceName) {
118:                return "drop sequence " + sequenceName;
119:            }
120:
121:            /* (non-Javadoc)
122:             * @see org.apache.ojb.broker.platforms.Platform#getJoinSyntaxType()
123:             */
124:            public byte getJoinSyntaxType() {
125:                return SQL92_NOPAREN_JOIN_SYNTAX;
126:            }
127:
128:            /* (non-Javadoc)
129:             * @see org.apache.ojb.broker.platforms.Platform#supportsPaging()
130:             */
131:            public boolean supportsPaging() {
132:                // [tomdz] there is no explicit paging support a la LIMIT in Mckoi (yet ?)
133:                return false;
134:            }
135:
136:            /* (non-Javadoc)
137:             * @see org.apache.ojb.broker.platforms.Platform#concatenate(java.lang.String[])
138:             */
139:            public String concatenate(String[] columns) {
140:                if (columns.length == 1) {
141:                    return columns[0];
142:                }
143:
144:                StringBuffer buf = new StringBuffer();
145:
146:                buf.append("concat(");
147:                for (int idx = 0; idx < columns.length; idx++) {
148:                    if (idx > 0) {
149:                        buf.append(",");
150:                    }
151:                    buf.append(columns[idx]);
152:                }
153:                buf.append(")");
154:
155:                return buf.toString();
156:            }
157:
158:            /* (non-Javadoc)
159:             * @see org.apache.ojb.broker.platforms.Platform#getEscapeClause(org.apache.ojb.broker.query.LikeCriteria)
160:             */
161:            public String getEscapeClause(LikeCriteria criteria) {
162:                // [tomdz] Mckoi does not support escape characters other than \
163:                // TODO    Shold we throw some kind of exception here if the escape character is different ?
164:                return "";
165:            }
166:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.