Source Code Cross Referenced for VirtoolDriver.java in  » Database-JDBC-Connection-Pool » proxool » org » logicalcobwebs » proxool » 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 JDBC Connection Pool » proxool » org.logicalcobwebs.proxool 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This software is released under a licence similar to the Apache Software Licence.
003:         * See org.logicalcobwebs.proxool.package.html for details.
004:         * The latest version is available at http://proxool.sourceforge.net
005:         */
006:        package org.logicalcobwebs.proxool;
007:
008:        import java.sql.Connection;
009:        import java.sql.Driver;
010:        import java.sql.DriverManager;
011:        import java.sql.DriverPropertyInfo;
012:        import java.sql.SQLException;
013:        import java.util.Properties;
014:
015:        /**
016:         * This class acts as a virtual pool. When you ask it for a connection it
017:         * delegates to one of the designated real pools. Some assumptions:
018:         *
019:         * Getting a connection needs to be very fast.
020:         *
021:         * Switching pools can be relatively slow (but just to get that in perspective,
022:         * > 100ms)
023:         *
024:         * We should detect pools that don't respond (timeout), throw certain
025:         * SQLExceptions, or are unacceptably slow.
026:         *
027:         * We should also allow simple load balancing between pools that are
028:         * up.
029:         *
030:         * @version $Revision: 1.2 $, $Date: 2003/03/03 11:12:02 $
031:         * @author Bill Horsman (bill@logicalcobwebs.co.uk)
032:         * @author $Author: billhorsman $ (current maintainer)
033:         * @since Proxool 0.5
034:         */
035:        public class VirtoolDriver implements  Driver {
036:
037:            private static final String VIRTOOL = "virtool";
038:
039:            private String[] activePools;
040:
041:            private int nextPool;
042:
043:            public Connection connect(String url, Properties info)
044:                    throws SQLException {
045:                String alias = activePools[nextPool];
046:
047:                // Now we need to move to the next pool. This code isn't ThreadSafe and
048:                // we don't want to make it so because it would have a performance
049:                // impact.
050:
051:                return null;
052:            }
053:
054:            public boolean acceptsURL(String url) throws SQLException {
055:                return (url.startsWith(VIRTOOL));
056:            }
057:
058:            public DriverPropertyInfo[] getPropertyInfo(String url,
059:                    Properties info) throws SQLException {
060:                return new DriverPropertyInfo[0];
061:            }
062:
063:            public int getMajorVersion() {
064:                throw new UnsupportedOperationException(
065:                        "This virtual driver doesn't support this operation.");
066:            }
067:
068:            public int getMinorVersion() {
069:                throw new UnsupportedOperationException(
070:                        "This virtual driver doesn't support this operation.");
071:            }
072:
073:            public boolean jdbcCompliant() {
074:                throw new UnsupportedOperationException(
075:                        "This virtual driver doesn't support this operation.");
076:            }
077:
078:            static {
079:                try {
080:                    DriverManager.registerDriver(new VirtoolDriver());
081:                } catch (SQLException e) {
082:                    System.out.println(e.toString());
083:                }
084:            }
085:
086:        }
087:
088:        /*
089:         Revision history:
090:         $Log: VirtoolDriver.java,v $
091:         Revision 1.2  2003/03/03 11:12:02  billhorsman
092:         fixed licence
093:
094:         Revision 1.1  2002/12/15 19:00:32  chr32
095:         Moved over from 'ext' source tree.
096:
097:         Revision 1.3  2002/11/12 20:19:18  billhorsman
098:         added some doc
099:
100:         Revision 1.2  2002/10/27 13:05:01  billhorsman
101:         checkstyle
102:
103:         Revision 1.1  2002/10/27 12:05:39  billhorsman
104:         early, early draft
105:
106:         */
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.