Java Doc for ConnectionPool.java in  » Database-JDBC-Connection-Pool » DBPool » snaq » db » 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 » DBPool » snaq.db 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   snaq.util.LogUtil
      snaq.util.ObjectPool
         snaq.db.ConnectionPool

ConnectionPool
public class ConnectionPool extends ObjectPool implements Comparable(Code)
Implementation of a database connection pool.
See Also:   snaq.db.CacheConnection
See Also:   snaq.db.CachedCallableStatement
See Also:   snaq.db.CachedPreparedStatement
author:
   Giles Winstanley

Inner Class :static class DefaultValidator implements ConnectionValidator


Constructor Summary
public  ConnectionPool(String name, int poolSize, int maxSize, long expiryTime, String url, String username, String password)
     Creates new connection pool.
public  ConnectionPool(String name, int poolSize, int maxSize, long expiryTime, String url, Properties props)
     Creates new connection pool.

Method Summary
final public  voidaddConnectionPoolListener(ConnectionPoolListener x)
     Adds an ConnectionPoolListener to the event notification list.
public  intcompareTo(Object o)
     Compares this instances to other instances by name.
protected  Reusablecreate()
     Creates a new database connection.
protected  voiddestroy(Reusable o)
     Closes the given connection.
protected  voidfreeConnection(Connection c)
     Returns a connection to the pool (for internal use only).
public  ConnectiongetConnection()
     Gets a connection from the pool.
public  ConnectiongetConnection(long timeout)
     Gets a connection from the pool.
public  PasswordDecodergetPasswordDecoder()
     Returns the current password decoder class.
public  ConnectionValidatorgetValidator()
     Returns the current validator class.
protected  booleanisValid(Reusable o)
     Validates a connection.
final public  voidremoveConnectionPoolListener(ConnectionPoolListener x)
     Removes an ConnectionPoolListener from the event notification list.
public  voidsetCaching(boolean b)
     Determines whether to perform statement caching.
public  voidsetCaching(boolean ss, boolean ps, boolean cs)
     Determines whether to perform statement caching.
public  voidsetPasswordDecoder(PasswordDecoder pd)
     Sets the password decoder class.
public  voidsetValidator(ConnectionValidator cv)
     Sets the validator class for connections.
public  StringtoString()
     Returns a descriptive string for this pool instance.


Constructor Detail
ConnectionPool
public ConnectionPool(String name, int poolSize, int maxSize, long expiryTime, String url, String username, String password)(Code)
Creates new connection pool.
Parameters:
  name - pool name
Parameters:
  poolSize - maximum number of pooled objects, or 0 for no limit
Parameters:
  maxSize - maximum number of possible objects, or 0 for no limit
Parameters:
  expiryTime - expiry time (milliseconds) for pooled object, or 0 for no expiry
Parameters:
  url - JDBC connection URL
Parameters:
  username - database username
Parameters:
  password - password for the database username supplied



ConnectionPool
public ConnectionPool(String name, int poolSize, int maxSize, long expiryTime, String url, Properties props)(Code)
Creates new connection pool.
Parameters:
  name - pool name
Parameters:
  poolSize - maximum number of pooled objects, or 0 for no limit
Parameters:
  maxSize - maximum number of possible objects, or 0 for no limit
Parameters:
  expiryTime - expiry time (milliseconds) for pooled object, or 0 for no expiry
Parameters:
  url - JDBC connection URL
Parameters:
  props - connection properties




Method Detail
addConnectionPoolListener
final public void addConnectionPoolListener(ConnectionPoolListener x)(Code)
Adds an ConnectionPoolListener to the event notification list.



compareTo
public int compareTo(Object o)(Code)
Compares this instances to other instances by name.



create
protected Reusable create() throws SQLException(Code)
Creates a new database connection.



destroy
protected void destroy(Reusable o)(Code)
Closes the given connection.



freeConnection
protected void freeConnection(Connection c) throws SQLException(Code)
Returns a connection to the pool (for internal use only). Connections obtained from the pool should be returned by calling the close() method on the connection.



getConnection
public Connection getConnection() throws SQLException(Code)
Gets a connection from the pool.



getConnection
public Connection getConnection(long timeout) throws SQLException(Code)
Gets a connection from the pool.



getPasswordDecoder
public PasswordDecoder getPasswordDecoder()(Code)
Returns the current password decoder class.



getValidator
public ConnectionValidator getValidator()(Code)
Returns the current validator class.



isValid
protected boolean isValid(Reusable o)(Code)
Validates a connection.



removeConnectionPoolListener
final public void removeConnectionPoolListener(ConnectionPoolListener x)(Code)
Removes an ConnectionPoolListener from the event notification list.



setCaching
public void setCaching(boolean b)(Code)
Determines whether to perform statement caching. This applies to all types of statements (normal, prepared, callable).



setCaching
public void setCaching(boolean ss, boolean ps, boolean cs)(Code)
Determines whether to perform statement caching.
Parameters:
  ss - whether to cache Statement objects
Parameters:
  ps - whether to cache PreparedStatement objects
Parameters:
  cs - whether to cache CallableStatement objects



setPasswordDecoder
public void setPasswordDecoder(PasswordDecoder pd)(Code)
Sets the password decoder class.



setValidator
public void setValidator(ConnectionValidator cv)(Code)
Sets the validator class for connections.



toString
public String toString()(Code)
Returns a descriptive string for this pool instance.



Methods inherited from snaq.util.ObjectPool
final public void addObjectPoolListener(ObjectPoolListener x)(Code)(Java Doc)
final protected void checkIn(Reusable o)(Code)(Java Doc)
final protected synchronized Reusable checkOut() throws Exception(Code)(Java Doc)
final protected synchronized Reusable checkOut(long timeout) throws Exception(Code)(Java Doc)
abstract protected Reusable create() throws Exception(Code)(Java Doc)
abstract protected void destroy(Reusable o)(Code)(Java Doc)
public void finalize()(Code)(Java Doc)
final public void flush()(Code)(Java Doc)
final public synchronized int getCheckedOut()(Code)(Java Doc)
final public long getExpiryTime()(Code)(Java Doc)
final public synchronized int getFreeCount()(Code)(Java Doc)
final public float getHitRate()(Code)(Java Doc)
final public int getMaxSize()(Code)(Java Doc)
final public String getName()(Code)(Java Doc)
protected Class getPoolClass()(Code)(Java Doc)
final public int getPoolSize()(Code)(Java Doc)
final public synchronized int getSize()(Code)(Java Doc)
final public void init(int num)(Code)(Java Doc)
final public boolean isAsyncDestroy()(Code)(Java Doc)
abstract protected boolean isValid(Reusable o)(Code)(Java Doc)
public void log(String logEntry)(Code)(Java Doc)
public void log(Throwable e, String logEntry)(Code)(Java Doc)
final public void release()(Code)(Java Doc)
final public synchronized void releaseAsync()(Code)(Java Doc)
final public void releaseForcibly()(Code)(Java Doc)
final public void removeObjectPoolListener(ObjectPoolListener x)(Code)(Java Doc)
final protected void resetHitCounter()(Code)(Java Doc)
final protected void setAccessFIFO()(Code)(Java Doc)
final protected void setAccessLIFO()(Code)(Java Doc)
final protected void setAccessRandom()(Code)(Java Doc)
final public void setAsyncDestroy(boolean b)(Code)(Java Doc)
final public void setParameters(int poolSize, int maxSize, long expiryTime)(Code)(Java Doc)

Fields inherited from snaq.util.LogUtil
protected DateFormat dateFormatddf(Code)(Java Doc)
protected boolean debug(Code)(Java Doc)
protected PrintStream log(Code)(Java Doc)
protected boolean logging(Code)(Java Doc)

Methods inherited from snaq.util.LogUtil
public synchronized void close()(Code)(Java Doc)
public PrintStream getLogStream()(Code)(Java Doc)
public boolean isDebug()(Code)(Java Doc)
public boolean isLogging()(Code)(Java Doc)
public synchronized void log(String prefix, String logEntry)(Code)(Java Doc)
public void log(String logEntry)(Code)(Java Doc)
public void log(Throwable e, String prefix, String logEntry)(Code)(Java Doc)
public void log(Throwable e, String logEntry)(Code)(Java Doc)
public void log(Throwable e)(Code)(Java Doc)
public synchronized void setDateFormat(DateFormat df)(Code)(Java Doc)
public void setDebug(boolean b)(Code)(Java Doc)
public synchronized void setLog(OutputStream out)(Code)(Java Doc)
public synchronized void setLog(PrintStream ps)(Code)(Java Doc)
public void setLogging(boolean b)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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