Java Doc for WbConnection.java in  » Database-Client » SQL-Workbench » workbench » 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 Client » SQL Workbench » workbench.db 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   workbench.db.WbConnection

WbConnection
public class WbConnection implements DbExecutionListener(Code)

author:
   support@sql-workbench.net


Field Summary
final public static  StringCONNECTION_CLOSED
    
final public static  StringCONNECTION_OPEN
    
final public static  StringPROP_AUTOCOMMIT
    
final public static  StringPROP_CATALOG
    
final public static  StringPROP_CONNECTION_STATE
    
final public static  StringPROP_SCHEMA
    

Constructor Summary
public  WbConnection(String anId, Connection aConn, ConnectionProfile aProfile)
     Create a new wrapper connection around the original SQL connection.

Method Summary
public synchronized  voidaddChangeListener(PropertyChangeListener l)
    
public  voidcatalogChanged(String oldCatalog, String newCatalog)
    
public  voidclearWarnings()
     This will clear the warnings from the connection object.
public  voidclose()
     This will actually close the connection to the DBMS.
public  voidcommit()
    
public  StatementcreateStatement()
    
public  StatementcreateStatementForQuery()
     Create a statement that produces ResultSets that are read only and forward only (for performance reasons) If the profile defined a default fetch size, this will be set as well.
public  voiddisconnect()
     Disconnect this connection.
public  booleanequals(Object o)
    
public  voidexecutionEnd(WbConnection conn, Object source)
    
public  voidexecutionStart(WbConnection conn, Object source)
    
public  booleangetAutoCommit()
    
public  StringgetCurrentSchema()
    
public  StringgetCurrentUser()
     Return the name of the current user.
protected  booleangetDDLNeedsCommit()
     Some DBMS need to commit DDL (CREATE, DROP, ...) statements.
public  StrBuffergetDatabaseInfoAsXml(StrBuffer indent)
    
public  StrBuffergetDatabaseInfoAsXml(StrBuffer indent, String namespace)
    
public  StringgetDatabaseProductName()
    
public  StringgetDatabaseVersion()
    
public  DbSettingsgetDbSettings()
    
public  StringgetDisplayString()
     Return a readable display of a connection.
public  StringgetDriverVersion()
    
public  StringgetId()
     Returns the internal ID of this connection.
public  booleangetIgnoreDropErrors()
    
public  DbMetadatagetMetadata()
    
public  DbObjectCachegetObjectCache()
    
public  StringgetOutputMessages()
    
public  PreparedStatementPoolgetPreparedStatementPool()
    
public  ConnectionProfilegetProfile()
    
public  ConnectiongetSqlConnection()
    
public  StringgetUrl()
    
public  StringgetWarnings()
     Return any warnings that are stored in the underlying SQL Connection.
public  inthashCode()
    
public  booleanisBusy()
    
public  booleanisClosed()
    
public  voidreleaseSavepoint(Savepoint sp)
    
public synchronized  voidremoveChangeListener(PropertyChangeListener l)
    
public  voidrollback(Savepoint sp)
    
public  voidrollback()
     Execute a rollback on the connection.
 voidrunPostConnectScript()
    
 voidrunPreDisconnectScript()
    
public  voidschemaChanged(String oldSchema, String newSchema)
    
public  booleanselectStartsTransaction()
     Some DBMS (e.g.
public  voidsetAutoCommit(boolean flag)
    
public  voidsetBusy(boolean flag)
    
public  SavepointsetSavepoint()
    
 voidsetSqlConnection(Connection aConn)
    
public  booleanshouldCommitDDL()
     Checks if DDL statement need a commit for this connection.
public  booleansupportsQueryTimeout()
    
public  booleansupportsSavepoints()
    
public  StringtoString()
    
public  voidtoggleAutoCommit()
    
public  booleanuseJdbcCommit()
    

Field Detail
CONNECTION_CLOSED
final public static String CONNECTION_CLOSED(Code)



CONNECTION_OPEN
final public static String CONNECTION_OPEN(Code)



PROP_AUTOCOMMIT
final public static String PROP_AUTOCOMMIT(Code)



PROP_CATALOG
final public static String PROP_CATALOG(Code)



PROP_CONNECTION_STATE
final public static String PROP_CONNECTION_STATE(Code)



PROP_SCHEMA
final public static String PROP_SCHEMA(Code)




Constructor Detail
WbConnection
public WbConnection(String anId, Connection aConn, ConnectionProfile aProfile) throws SQLException(Code)
Create a new wrapper connection around the original SQL connection. This will also initialize a WbConnection.DbMetadata instance.




Method Detail
addChangeListener
public synchronized void addChangeListener(PropertyChangeListener l)(Code)



catalogChanged
public void catalogChanged(String oldCatalog, String newCatalog)(Code)



clearWarnings
public void clearWarnings()(Code)
This will clear the warnings from the connection object. Some drivers will not replace existing warnings until clearWarnings() is called, thus SQL Workbench would show the same error message over and over again. This method also works around a bug in the Oracle JDBC driver, because that does not properly clear the warnings list.



close
public void close()(Code)
This will actually close the connection to the DBMS. It will also free an resources from the DbMetadata object and shutdown the keep alive thread.



commit
public void commit() throws SQLException(Code)



createStatement
public Statement createStatement() throws SQLException(Code)



createStatementForQuery
public Statement createStatementForQuery() throws SQLException(Code)
Create a statement that produces ResultSets that are read only and forward only (for performance reasons) If the profile defined a default fetch size, this will be set as well.
throws:
  java.sql.SQLException -



disconnect
public void disconnect()(Code)
Disconnect this connection. This is delegated to the Connection Manager because for certain DBMS some cleanup works needs to be done. And the ConnectionMgr is the only one who knows if there are more connections around, which might influence what needs to be cleaned up (Currently this is only HSQLDB, but who knows...)



equals
public boolean equals(Object o)(Code)



executionEnd
public void executionEnd(WbConnection conn, Object source)(Code)



executionStart
public void executionStart(WbConnection conn, Object source)(Code)



getAutoCommit
public boolean getAutoCommit()(Code)



getCurrentSchema
public String getCurrentSchema()(Code)



getCurrentUser
public String getCurrentUser()(Code)
Return the name of the current user. Wrapper for DatabaseMetaData.getUserName() that throws no Exception



getDDLNeedsCommit
protected boolean getDDLNeedsCommit()(Code)
Some DBMS need to commit DDL (CREATE, DROP, ...) statements. If the current connection needs a commit for a DDL, this will return true. The metadata class reads the names of those DBMS from the Settings object!



getDatabaseInfoAsXml
public StrBuffer getDatabaseInfoAsXml(StrBuffer indent)(Code)



getDatabaseInfoAsXml
public StrBuffer getDatabaseInfoAsXml(StrBuffer indent, String namespace)(Code)
Returns information about the DBMS and the JDBC driver in the XML format used for the XML export



getDatabaseProductName
public String getDatabaseProductName()(Code)



getDatabaseVersion
public String getDatabaseVersion()(Code)



getDbSettings
public DbSettings getDbSettings()(Code)



getDisplayString
public String getDisplayString()(Code)
Return a readable display of a connection. This might actually send a SELECT to the database to retrieve the current user or schema.
See Also:   WbConnection.getCurrentUser()
See Also:   DbMetadata.getSchemaToUse
See Also:   DbMetadata.getCurrentCatalog



getDriverVersion
public String getDriverVersion()(Code)



getId
public String getId()(Code)
Returns the internal ID of this connection. the internal id of this connection.



getIgnoreDropErrors
public boolean getIgnoreDropErrors()(Code)



getMetadata
public DbMetadata getMetadata()(Code)



getObjectCache
public DbObjectCache getObjectCache()(Code)



getOutputMessages
public String getOutputMessages()(Code)



getPreparedStatementPool
public PreparedStatementPool getPreparedStatementPool()(Code)



getProfile
public ConnectionProfile getProfile()(Code)
The profile associated with this connection



getSqlConnection
public Connection getSqlConnection()(Code)



getUrl
public String getUrl()(Code)



getWarnings
public String getWarnings()(Code)
Return any warnings that are stored in the underlying SQL Connection. The warnings are then cleared from the connection object.
See Also:   WbConnection.clearWarnings() any warnings reported from the server, null if no warnings are available.



hashCode
public int hashCode()(Code)



isBusy
public boolean isBusy()(Code)



isClosed
public boolean isClosed()(Code)



releaseSavepoint
public void releaseSavepoint(Savepoint sp)(Code)
A non-exception throwing wrapper around Connection.releaseSavepoint(Savepoint)



removeChangeListener
public synchronized void removeChangeListener(PropertyChangeListener l)(Code)



rollback
public void rollback(Savepoint sp)(Code)
A non-exception throwing wrapper around Connection.rollback(Savepoint)



rollback
public void rollback() throws SQLException(Code)
Execute a rollback on the connection.



runPostConnectScript
void runPostConnectScript()(Code)



runPreDisconnectScript
void runPreDisconnectScript()(Code)



schemaChanged
public void schemaChanged(String oldSchema, String newSchema)(Code)



selectStartsTransaction
public boolean selectStartsTransaction()(Code)
Some DBMS (e.g. MySQL) seem to start a new transaction in default isolation mode. Which means that if the SELECT is not committed, no changes will be visible until a commit is issued. In the DbExplorer this is a problem, as the user has no way of sending a commit to end the transation if the DbExplorer uses a separate connection. The workbench.gui.dbobjects.TableDataPanel will issue a commit after retrieving the data if this method returns true.
See Also:   workbench.gui.dbobjects.TableDataPanel.doRetrieve(boolean)
See Also:   workbench.gui.dbobjects.TableDataPanel.showRowCount



setAutoCommit
public void setAutoCommit(boolean flag) throws SQLException(Code)



setBusy
public void setBusy(boolean flag)(Code)



setSavepoint
public Savepoint setSavepoint() throws SQLException(Code)



setSqlConnection
void setSqlConnection(Connection aConn) throws SQLException(Code)



shouldCommitDDL
public boolean shouldCommitDDL()(Code)
Checks if DDL statement need a commit for this connection. false if autocommit is on or the DBMS does not support DDL transactions
See Also:   WbConnection.getDdlNeedsCommit()



supportsQueryTimeout
public boolean supportsQueryTimeout()(Code)



supportsSavepoints
public boolean supportsSavepoints()(Code)



toString
public String toString()(Code)



toggleAutoCommit
public void toggleAutoCommit()(Code)



useJdbcCommit
public boolean useJdbcCommit()(Code)



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.