Java Doc for MultiConnectionImplementation.java in  » Database-ORM » MMBase » org » mmbase » module » database » 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 ORM » MMBase » org.mmbase.module.database 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.mmbase.module.database.ConnectionWrapper
      org.mmbase.module.database.MultiConnectionImplementation

MultiConnectionImplementation
public class MultiConnectionImplementation extends ConnectionWrapper implements MultiConnection(Code)
MultiConnection is a replacement class for Connection it provides you a multiplexed and reuseable connections from the connection pool. The main function of this class is to 'log' (keep) the last sql statement passed to it. Another function is to keep state (i.e. notifying that it is busy), and to make itself available again to teh connectionpool once it is finished (closed).
author:
   vpro
author:
   Pierre van Rooden
version:
   $Id: MultiConnectionImplementation.java,v 1.2 2007/12/06 08:05:51 michiel Exp $
since:
   MMBase-1.9 (as 'MultiConnection' in < 1.9)


Field Summary
final public static  intCON_BUSY
    
final public static  intCON_FAILED
    
final public static  intCON_FINISHED
    
final public static  intCON_UNUSED
    
 StringlastSql
    
 MultiPoolparent
    
public static  longqueries
    
 ExceptionstackTrace
    
public  intstate
    

Constructor Summary
public  MultiConnectionImplementation(MultiPool parent, Connection con)
    

Method Summary
public  booleancheckAfterException()
     Tries to fix the this connection, if it proves to be broken.
public  booleancheckSQLError(Exception e)
    
public  voidclaim()
    
public  voidclose()
    
public  StatementcreateStatement()
    
public  StatementcreateStatement(int resultSetType, int resultSetConcurrency)
    
public  StatementcreateStatement(int type, int concurrency, int holdability)
    
public  StringgetLastSQL()
    
public  MultiPoolgetParent()
    
public  ConnectiongetRealConnection()
     Return the underlying real connection.
public  ExceptiongetStackTrace()
    
public  intgetStartTime()
     Returns the moment on which the last SQL statement was started in seconds after 1970.
public  longgetStartTimeMillis()
     Returns the moment on which the last SQL statement was started in milliseconds after 1970.
public  StringgetStateString()
    
public  intgetUsage()
    
public  voidrealclose()
    
public  voidrelease()
    
public  voidresetUsage()
    
public  voidsetAutoCommit(boolean enableAutoCommit)
     If "autoCommit" is true, then all subsequent SQL statements will be executed and committed as individual transactions.
public  voidsetLastSQL(String sql)
    
public  StringtoString()
    
public  voidwrap(Connection con)
    

Field Detail
CON_BUSY
final public static int CON_BUSY(Code)



CON_FAILED
final public static int CON_FAILED(Code)



CON_FINISHED
final public static int CON_FINISHED(Code)



CON_UNUSED
final public static int CON_UNUSED(Code)



lastSql
String lastSql(Code)



parent
MultiPool parent(Code)



queries
public static long queries(Code)



stackTrace
Exception stackTrace(Code)



state
public int state(Code)




Constructor Detail
MultiConnectionImplementation
public MultiConnectionImplementation(MultiPool parent, Connection con)(Code)

since:
   MMBase-1.7




Method Detail
checkAfterException
public boolean checkAfterException() throws SQLException(Code)
Tries to fix the this connection, if it proves to be broken. It is supposed to be broken if the query "SELECT 1 FROM " does yield an exception. This method is meant to be called in the catch after trying to use the connection. true if connection was broken and successfully repaired. false if connection was not broken.
throws:
  SQLException - If connection is broken and no new one could be obtained.
since:
   MMBase-1.7.1



checkSQLError
public boolean checkSQLError(Exception e)(Code)



claim
public void claim()(Code)



close
public void close() throws SQLException(Code)
Close connections



createStatement
public Statement createStatement() throws SQLException(Code)
createStatement returns an SQL Statement object



createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException(Code)
createStatement returns an SQL Statement object



createStatement
public Statement createStatement(int type, int concurrency, int holdability) throws SQLException(Code)

since:
   MMBase 1.5, JDBC 1.4



getLastSQL
public String getLastSQL()(Code)



getParent
public MultiPool getParent()(Code)



getRealConnection
public Connection getRealConnection()(Code)
Return the underlying real connection. NOTE: use with extreme caution! MMBase is supposed to look after it's own connections. This method is public only for the reason that specific database implementations need access to this connection in order to safely clear them before they can be put back in the connection pool. #unwrap(Connection.class)



getStackTrace
public Exception getStackTrace()(Code)



getStartTime
public int getStartTime()(Code)
Returns the moment on which the last SQL statement was started in seconds after 1970.



getStartTimeMillis
public long getStartTimeMillis()(Code)
Returns the moment on which the last SQL statement was started in milliseconds after 1970.



getStateString
public String getStateString()(Code)



getUsage
public int getUsage()(Code)



realclose
public void realclose() throws SQLException(Code)
Close connections



release
public void release()(Code)



resetUsage
public void resetUsage()(Code)

since:
   MMBase-1.8



setAutoCommit
public void setAutoCommit(boolean enableAutoCommit) throws SQLException(Code)
If "autoCommit" is true, then all subsequent SQL statements will be executed and committed as individual transactions. Otherwise (if "autoCommit" is false) then subsequent SQL statements will all be part of the same transaction , which must be explicitly committed with either a "commit" or "rollback" call. By default new connections are initialized with autoCommit "true".



setLastSQL
public void setLastSQL(String sql)(Code)



toString
public String toString()(Code)



wrap
public void wrap(Connection con)(Code)



Fields inherited from org.mmbase.module.database.ConnectionWrapper
protected Connection con(Code)(Java Doc)

Methods inherited from org.mmbase.module.database.ConnectionWrapper
public void clearWarnings() throws SQLException(Code)(Java Doc)
public void close() throws SQLException(Code)(Java Doc)
public void commit() throws SQLException(Code)(Java Doc)
public Array createArrayOf(String typeName, Object[] elements) throws SQLException(Code)(Java Doc)
public Statement createStatement() throws SQLException(Code)(Java Doc)
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException(Code)(Java Doc)
public Statement createStatement(int type, int concurrency, int holdability) throws SQLException(Code)(Java Doc)
public Struct createStruct(String typeName, Object[] attributes) throws SQLException(Code)(Java Doc)
public boolean getAutoCommit() throws SQLException(Code)(Java Doc)
public String getCatalog() throws SQLException(Code)(Java Doc)
public String getClientInfo(String name) throws SQLException(Code)(Java Doc)
public Properties getClientInfo() throws SQLException(Code)(Java Doc)
public int getHoldability() throws SQLException(Code)(Java Doc)
public DatabaseMetaData getMetaData() throws SQLException(Code)(Java Doc)
public int getTransactionIsolation() throws SQLException(Code)(Java Doc)
public Map getTypeMap() throws SQLException(Code)(Java Doc)
public SQLWarning getWarnings() throws SQLException(Code)(Java Doc)
public boolean isClosed() throws SQLException(Code)(Java Doc)
public boolean isReadOnly() throws SQLException(Code)(Java Doc)
public boolean isValid(int i) throws SQLException(Code)(Java Doc)
public boolean isWrapperFor(Class iface)(Code)(Java Doc)
public String nativeSQL(String query) throws SQLException(Code)(Java Doc)
public CallableStatement prepareCall(String sql) throws SQLException(Code)(Java Doc)
public CallableStatement prepareCall(String sql, int i, int y) throws SQLException(Code)(Java Doc)
public CallableStatement prepareCall(String sql, int type, int concurrency, int holdability) throws SQLException(Code)(Java Doc)
public PreparedStatement prepareStatement(String sql) throws SQLException(Code)(Java Doc)
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException(Code)(Java Doc)
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException(Code)(Java Doc)
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException(Code)(Java Doc)
public PreparedStatement prepareStatement(String sql, int type, int concurrency, int holdability) throws SQLException(Code)(Java Doc)
public PreparedStatement prepareStatement(String sql, int i, int y) throws SQLException(Code)(Java Doc)
public void releaseSavepoint(Savepoint savepoint) throws SQLException(Code)(Java Doc)
public void rollback() throws SQLException(Code)(Java Doc)
public void rollback(Savepoint savepoint) throws SQLException(Code)(Java Doc)
public void setAutoCommit(boolean enableAutoCommit) throws SQLException(Code)(Java Doc)
public void setCatalog(String catalog) throws SQLException(Code)(Java Doc)
public void setHoldability(int holdability) throws SQLException(Code)(Java Doc)
protected void setLastSQL(String sql)(Code)(Java Doc)
public void setReadOnly(boolean readOnly) throws SQLException(Code)(Java Doc)
public Savepoint setSavepoint() throws SQLException(Code)(Java Doc)
public Savepoint setSavepoint(String name) throws SQLException(Code)(Java Doc)
public void setTransactionIsolation(int level) throws SQLException(Code)(Java Doc)
public void setTypeMap(Map mp) throws SQLException(Code)(Java Doc)
public T unwrap(Class<T> iface)(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.