Java Doc for JdbcDataSource.java in  » Net » james-2.3.1 » org » apache » james » util » mordred » 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 » Net » james 2.3.1 » org.apache.james.util.mordred 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.james.util.mordred.JdbcDataSource

JdbcDataSource
public class JdbcDataSource extends AbstractLogEnabled implements Configurable,Runnable,Disposable,DataSourceComponent(Code)

This is a reliable DataSource implementation, based on the pooling logic written for Town and the configuration found in Avalon's excalibur code.

This uses the normal java.sql.Connection object and java.sql.DriverManager. The Configuration is like this:

 <jdbc>
 <pool-controller min="5" max="10" connection-class="my.overrided.ConnectionClass">
 <keep-alive>select 1</keep-alive>
 </pool-controller>
 <driver>com.database.jdbc.JdbcDriver</driver>
 <dburl>jdbc:driver://host/mydb</dburl>
 <user>username</user>
 <password>password</password>
 </jdbc>
 


version:
   CVS $Revision: 494012 $
since:
   4.0


Field Summary
final public static  longACTIVE_CONN_HARD_TIME_LIMIT
    
final public static  longACTIVE_CONN_TIME_LIMIT
    
final public static  longCONN_IDLE_LIMIT
    


Method Summary
public  voidconfigure(Configuration configuration)
    
protected  voiddebug(String message)
    
public  voiddispose()
     The dispose operation is called at the end of a components lifecycle.
public  ConnectiongetConnection()
     Implements the ConnDefinition behavior when a connection is needed.
protected  voidinfo(String message)
    
public  voidkillConnection(PoolConnEntry entry)
     Implements the ConnDefinition behavior when something bad has happened to a connection.
public  voidreleaseConnection(PoolConnEntry entry)
     Implements the ConnDefinition behavior when a connection is no longer needed.
public  voidrun()
     Background thread that checks if there are fewer connections open than minConn specifies, and checks whether connections have been checked out for too long, killing them.
protected  voidwarn(String message)
    

Field Detail
ACTIVE_CONN_HARD_TIME_LIMIT
final public static long ACTIVE_CONN_HARD_TIME_LIMIT(Code)



ACTIVE_CONN_TIME_LIMIT
final public static long ACTIVE_CONN_TIME_LIMIT(Code)



CONN_IDLE_LIMIT
final public static long CONN_IDLE_LIMIT(Code)





Method Detail
configure
public void configure(Configuration configuration) throws ConfigurationException(Code)

See Also:   org.apache.avalon.framework.configuration.Configurable.configure(Configuration)



debug
protected void debug(String message)(Code)



dispose
public void dispose()(Code)
The dispose operation is called at the end of a components lifecycle. Cleans up all JDBC connections.
throws:
  Exception - if an error is encountered during shutdown



getConnection
public Connection getConnection() throws SQLException(Code)
Implements the ConnDefinition behavior when a connection is needed. Checks the pool of connections to see if there is one available. If there is not and we are below the max number of connections limit, it tries to create another connection. It retries this 10 times until a connection is available or can be created java.sql.Connection
throws:
  SQLException - Document throws!



info
protected void info(String message)(Code)



killConnection
public void killConnection(PoolConnEntry entry)(Code)
Implements the ConnDefinition behavior when something bad has happened to a connection. If a sql command was provided in the properties file, it will run this and attempt to determine whether the connection is still valid. If it is, it recycles this connection back into the pool. If it is not, it closes the connection.
Parameters:
  entry - the connection that had problems



releaseConnection
public void releaseConnection(PoolConnEntry entry)(Code)
Implements the ConnDefinition behavior when a connection is no longer needed. This resets flags on the wrapper of the connection to allow others to use this connection.
Parameters:
  entry -



run
public void run()(Code)
Background thread that checks if there are fewer connections open than minConn specifies, and checks whether connections have been checked out for too long, killing them.



warn
protected void warn(String message)(Code)



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.