Source Code Cross Referenced for Oracle.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » vdl » dbdriver » 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 » Workflow Engines » pegasus 2.1.0 » org.griphyn.vdl.dbdriver 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file or a portion of this file is licensed under the terms of
003:         * the Globus Toolkit Public License, found in file ../GTPL, or at
004:         * http://www.globus.org/toolkit/download/license.html. This notice must
005:         * appear in redistributions of this file, with or without modification.
006:         *
007:         * Redistributions of this Software, with or without modification, must
008:         * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
009:         * some other similar material which is provided with the Software (if
010:         * any).
011:         *
012:         * Copyright 1999-2004 University of Chicago and The University of
013:         * Southern California. All rights reserved.
014:         */
015:        package org.griphyn.vdl.dbdriver;
016:
017:        import org.griphyn.vdl.dbdriver.DatabaseDriver;
018:        import java.sql.*;
019:        import java.util.*;
020:        import org.griphyn.vdl.util.*;
021:
022:        /**
023:         * This class implements the driver API for the production strength
024:         * rDBMS by Oracle. This class is currently an empty non-working
025:         * stand-in. We will fill this stand-in with life at some later time.<p>
026:         *
027:         * In order to use the Oracle driver, you must have access to Oracle's
028:         * thin JDCB client.<p>
029:         *
030:         * @author Jens-S. Vöckler
031:         * @author Yong Zhao
032:         * @version $Revision: 50 $
033:         *
034:         * @see DatabaseDriver
035:         * @see org.griphyn.vdl.dbschema
036:         */
037:        public class Oracle extends DatabaseDriver {
038:            /**
039:             * Default constructor. As the constructor will do nothing, please use
040:             * the connect method to obtain a database connection. 
041:             *
042:             * @see #connect( String, Properties, Set )
043:             */
044:            public Oracle() {
045:                super ();
046:            }
047:
048:            /**
049:             * Establish a connection to your database. The parameters will often
050:             * be ignored or abused for different purposes on different backends.
051:             * It is assumed that the connection is not in auto-commit mode, and
052:             * explicit commits must be issued. 
053:             *
054:             * @param url      the contact string to database, or schema location
055:             * @param info     additional parameters, usually username and password
056:             * @param tables   is a set of all table names in the schema. The
057:             *                 existence of all tables will be checked to verify
058:             *                 that the schema is active in the database. 
059:             * @return true if the connection succeeded, false otherwise. Usually,
060:             * false is returned, if the any of the tables or sequences is missing. 
061:             * @exception if the driver is incapable of establishing a connection.
062:             */
063:            public boolean connect(String url, Properties info, Set tables)
064:                    throws SQLException, ClassNotFoundException {
065:                // load JDBC driver class into memory
066:                return this .connect("org.postgresql.Driver", url, info, tables);
067:            }
068:
069:            /**
070:             * Determines, if the backend is expensive, and results should be cached.
071:             * Ideally, this will move transparently into the backend itself.
072:             * @return true if caching is advisable, false for no caching.
073:             */
074:            public boolean cachingMakesSense() {
075:                return true;
076:            }
077:
078:            /**
079:             * Determines, if the JDBC driver is the right one for the database we
080:             * talk to. Throws an exception if not. 
081:             */
082:            public void driverMatch() throws SQLException {
083:                DatabaseMetaData m = m_connection.getMetaData();
084:                String db = m.getDatabaseProductVersion();
085:                String jdbc = m.getDriverMajorVersion() + "."
086:                        + m.getDriverMinorVersion();
087:                if (!db.substring(0, jdbc.length()).equals(jdbc))
088:                    throw new RuntimeException("JDBC driver version " + jdbc
089:                            + " does not match DBMS version " + db);
090:            }
091:
092:            /**
093:             * Quotes a string that may contain special SQL characters.
094:             * @param s is the raw string.
095:             * @return the quoted string, which may be just the input string.
096:             */
097:            public String quote(String s) {
098:                if (s.indexOf('\'') != -1) {
099:                    StringBuffer result = new StringBuffer();
100:                    for (int i = 0; i < s.length(); ++i) {
101:                        char ch = s.charAt(i);
102:                        result.append(ch);
103:                        if (ch == '\'')
104:                            result.append(ch);
105:                    }
106:                    return result.toString();
107:                } else {
108:                    return s;
109:                }
110:            }
111:
112:            /**
113:             * Obtains the next value from a sequence. JDBC drivers which allow
114:             * explicit access to sequence generator will return a valid value 
115:             * in this function. All other JDBC drivers should return -1.
116:             *
117:             * @param name is the name of the sequence.
118:             * @return the next sequence number. 
119:             * @exception if something goes wrong while fetching the new value. 
120:             */
121:            public long sequence1(String name) throws SQLException {
122:                throw new SQLException(this .getClass().getName()
123:                        + ": Method not implemented, "
124:                        + "please notify vds-support@griphyn.org");
125:            }
126:
127:            /**
128:             * Obtains the sequence value for the current statement. JDBC driver
129:             * that permit insertion of NULL into auto-increment value should use
130:             * this method to return the inserted ID value via the statements
131:             * getGeneratedKeys(). Other JDBC drivers should treat return the
132:             * parametric id.
133:             *
134:             * @param s is a statment or prepared statement
135:             * @param name is the name of the sequence.
136:             * @param pos is the column number of the auto-increment column.
137:             * @return the next sequence number. 
138:             * @exception if something goes wrong while fetching the new value. 
139:             */
140:            public long sequence2(Statement s, String name, int pos)
141:                    throws SQLException {
142:                throw new SQLException(this .getClass().getName()
143:                        + ": Method not implemented, "
144:                        + "please notify vds-support@griphyn.org");
145:            }
146:
147:            /**
148:             * Predicate to tell the schema, if using a string instead of number
149:             * will result in the speedier index scans instead of sequential scans.
150:             * PostGreSQL suffers from this problem.
151:             *
152:             * @return true, if using strings instead of integers and bigints
153:             * will yield better performance. 
154:             *
155:             */
156:            public boolean preferString() {
157:                return true;
158:            }
159:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.