Source Code Cross Referenced for utilMain14.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » tools » ij » 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 DBMS » db derby 10.2 » org.apache.derby.impl.tools.ij 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:           Derby - Class org.apache.derby.impl.tools.ij.utilMain14
004:
005:           Licensed to the Apache Software Foundation (ASF) under one or more
006:           contributor license agreements.  See the NOTICE file distributed with
007:           this work for additional information regarding copyright ownership.
008:           The ASF licenses this file to You under the Apache License, Version 2.0
009:           (the "License"); you may not use this file except in compliance with
010:           the License.  You may obtain a copy of the License at
011:
012:              http://www.apache.org/licenses/LICENSE-2.0
013:
014:           Unless required by applicable law or agreed to in writing, software
015:           distributed under the License is distributed on an "AS IS" BASIS,
016:           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:           See the License for the specific language governing permissions and
018:           limitations under the License.
019:
020:         */
021:
022:        package org.apache.derby.impl.tools.ij;
023:
024:        import org.apache.derby.iapi.reference.JDBC20Translation;
025:        import org.apache.derby.iapi.reference.JDBC30Translation;
026:
027:        import java.util.Hashtable;
028:        import java.sql.Connection;
029:        import java.sql.SQLException;
030:        import java.sql.Statement;
031:
032:        import org.apache.derby.iapi.tools.i18n.LocalizedOutput;
033:
034:        /**
035:         This class is utilities specific to the two ij Main's.
036:         This factoring enables sharing the functionality for
037:         single and dual connection ij runs.
038:
039:         @author jerry
040:         */
041:        class utilMain14 extends utilMain {
042:            private static final String JDBC_NOTSUPPORTED = "JDBC 3 method called - not yet supported";
043:
044:            /**
045:             * Set up the test to run with 'numConnections' connections/users.
046:             *
047:             * @param numConnections	The number of connections/users to test.
048:             *
049:             */
050:            utilMain14(int numConnections, LocalizedOutput out)
051:                    throws ijFatalException {
052:                super (numConnections, out, (Hashtable) null);
053:            }
054:
055:            /**
056:             * Set up the test to run with 'numConnections' connections/users.
057:             *
058:             * @param numConnections	The number of connections/users to test.
059:             * @param ignoreErrors		A list of errors to ignore.  If null,
060:             *							all errors are printed out and nothing
061:             *							is fatal.  If non-null, if an error is
062:             *							hit and it is in this list, it is silently	
063:             *							ignore.  Otherwise, an ijFatalException is
064:             *							thrown.  ignoreErrors is used for stress
065:             *							tests.
066:             *
067:             */
068:            utilMain14(int numConnections, LocalizedOutput out,
069:                    Hashtable ignoreErrors) throws ijFatalException {
070:                super (numConnections, out, ignoreErrors);
071:            }
072:
073:            /**
074:             * Connections by default create ResultSet objects with holdability true. This method can be used
075:             * to change the holdability of the connection by passing one of ResultSet.HOLD_CURSORS_OVER_COMMIT
076:             * or ResultSet.CLOSE_CURSORS_AT_COMMIT
077:             *
078:             * @param conn			The connection.
079:             * @param holdType	The new holdability for the Connection object.
080:             *
081:             * @return	The connection object with holdability set to passed value.
082:             */
083:            Connection setHoldability(Connection conn, int holdType)
084:                    throws SQLException {
085:                conn.setHoldability(holdType);
086:                return conn;
087:            }
088:
089:            /**
090:            	JDBC 3.0
091:             * Retrieves the current holdability of ResultSet objects created using this
092:             * Connection object.
093:             *
094:             *
095:             * @return  The holdability, one of ResultSet.HOLD_CURSORS_OVER_COMMIT
096:             * or ResultSet.CLOSE_CURSORS_AT_COMMIT
097:             *
098:             */
099:            int getHoldability(Connection conn) throws SQLException {
100:                return conn.getHoldability();
101:            }
102:
103:            /**
104:             * Create the right kind of statement (scrolling or not)
105:             * off of the specified connection.
106:             *
107:             * @param conn			The connection.
108:             * @param scrollType	The scroll type of the cursor.
109:             *
110:             * @return	The statement.
111:             */
112:            Statement createStatement(Connection conn, int scrollType,
113:                    int holdType) throws SQLException {
114:                Statement stmt;
115:                try {
116:                    stmt = conn.createStatement(scrollType,
117:                            JDBC20Translation.CONCUR_READ_ONLY, holdType);
118:                } catch (SQLException se) {
119:                    //since jcc doesn't yet support JDBC3.0 we have to go back to JDBC2.0 
120:                    if (isJCC && se.getMessage().equals(JDBC_NOTSUPPORTED))
121:                        stmt = conn.createStatement(scrollType,
122:                                JDBC20Translation.CONCUR_READ_ONLY);
123:                    else
124:                        throw se;
125:                } catch (AbstractMethodError ame) {
126:                    //because weblogic 4.5 doesn't yet implement jdbc 2.0 interfaces, need
127:                    //to go back to jdbc 1.x functionality
128:                    //The jcc obfuscated jar gets this error
129:                    if (isJCC)
130:                        stmt = conn.createStatement(scrollType,
131:                                JDBC20Translation.CONCUR_READ_ONLY);
132:                    else
133:                        stmt = conn.createStatement();
134:                }
135:                return stmt;
136:            }
137:
138:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.