Java Doc for DBConnection.java in  » J2EE » Enhydra-Application-Framework » com » lutris » appserver » server » sql » 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 » J2EE » Enhydra Application Framework » com.lutris.appserver.server.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.lutris.appserver.server.sql.DBConnection

DBConnection
public interface DBConnection (Code)
This interface defines a database connection.
author:
   Paul Morgan
since:
   LBS1.8
version:
   $Revision: 1.1 $




Method Summary
public  voidallocate()
     Method called when this connection object is allocated from the connection allocator.
public  voidclose()
     Close this connection.
public  voidcommit()
     Commit a transaction.
exception:
  java.sql.SQLException - If a database access error occurs.
public  booleanexecute(String sql)
     Execute a SQL statement that does not return a resultset.
public  ResultSetexecuteQuery(PreparedStatement preparedStmt, String msg)
     Execute a prepared query statement.
public  ResultSetexecuteQuery(String sql)
     Execute a SQL query statement.
public  intexecuteUpdate(String sql)
     Execute a SQL update statement.
public  intexecuteUpdate(PreparedStatement preparedStmt, String msg)
     Execute a prepared update statement.
public  ConnectiongetConnection()
     Get the underlying Connection object.
public  StringgetDatabaseName()
    
public  intgetGeneration()
     Get the generation number specified when the connection was created.
public  StringgetUrl()
     Get the database URL.
public  StringgetUser()
     Get the database user name.
public  booleanhandleException(SQLException sqlExcept)
     Check if a connection is valid after an SQL exception is thrown.
public  voidincrRequestCount()
     Increment the count of the number of requests against this connection.
public  booleanisMarkedForDrop()
    
public  CallableStatementprepareCall(String sql)
     Creates a CallableStatement object for calling database stored procedures.
public  PreparedStatementprepareStatement(String sql)
     Get a prepared statement given an SQL string.
public  voidrelease()
     Return this connection to its allocator.
public  voidreset()
     Closes down all query-specific resources.
public  voidrollback()
     Rollback a transaction.
public  voidsetAutoCommit(boolean on)
     Autocommit on/off.
Parameters:
  on - false to disable auto commit mode.
public  voidvalidate()
     Validates this connection.
public  voidwarningCheck(ResultSet resultSet)
     Check for warnings in a result set.



Method Detail
allocate
public void allocate() throws SQLException(Code)
Method called when this connection object is allocated from the connection allocator.
exception:
  SQLException - if reset had no been called on the previous operation.



close
public void close()(Code)
Close this connection. Use by the connection allocator when this object is no longer used. Errors are ignored.



commit
public void commit() throws SQLException(Code)
Commit a transaction.
exception:
  java.sql.SQLException - If a database access error occurs.



execute
public boolean execute(String sql) throws SQLException(Code)
Execute a SQL statement that does not return a resultset. This is a wrapper that adds logging. Once the query has completed, reset() should be called.
Parameters:
  sql - The SQL query statement True if the next result is a ResultSet; false if it isan update count or there are no more results.
exception:
  java.sql.SQLException - If a SQL error occured executing thestatement.



executeQuery
public ResultSet executeQuery(PreparedStatement preparedStmt, String msg) throws SQLException(Code)
Execute a prepared query statement. Once the query has completed, reset() should be called.
Parameters:
  preparedStmt - The statement to execute.
Parameters:
  msg - for logging/debug purposes Query result set, do not call close, use reset(),
exception:
  java.sql.SQLException - If a SQL error occured executing thestatement.



executeQuery
public ResultSet executeQuery(String sql) throws SQLException(Code)
Execute a SQL query statement. This is a wrapper that adds logging. Once the query has completed, reset() should be called.
Parameters:
  sql - The SQL query statement Query result set, do not call close, use reset(),
exception:
  java.sql.SQLException - If a SQL error occured executing thestatement.



executeUpdate
public int executeUpdate(String sql) throws SQLException(Code)
Execute a SQL update statement. This is a wrapper that adds logging. Once the update has completed, reset() should be called.
Parameters:
  sql - The SQL query statementEither the row count for UPDATE, INSERT, DELETE or 0 forSQL statements that return nothing.
exception:
  java.sql.SQLException - If a SQL error occured executing the update.



executeUpdate
public int executeUpdate(PreparedStatement preparedStmt, String msg) throws SQLException(Code)
Execute a prepared update statement. Once the update has completed, reset() should be called.
Parameters:
  preparedStmt - The statement to execute.
Parameters:
  msg - for logging/debug purposes Either the row count for UPDATE, INSERT, DELETE or 0 forSQL statements that return nothing.
exception:
  java.sql.SQLException - If a SQL error occured executing thestatement.



getConnection
public Connection getConnection()(Code)
Get the underlying Connection object. Use with extreme caution. the connection object



getDatabaseName
public String getDatabaseName()(Code)
database name of current connection



getGeneration
public int getGeneration()(Code)
Get the generation number specified when the connection was created. The generation number.



getUrl
public String getUrl()(Code)
Get the database URL. The database URL.



getUser
public String getUser()(Code)
Get the database user name. Normally user for error messages. The database user name.



handleException
public boolean handleException(SQLException sqlExcept)(Code)
Check if a connection is valid after an SQL exception is thrown. If it is not usable, then the connection is dropped from the connection allocator and closed. The connection is then no longer usable.
Parameters:
  sqlExcept - the SQL exception that occured. trueif the exception does not affect thisconnection object. False otherwise - in which casethis connection object is no longer usable.



incrRequestCount
public void incrRequestCount()(Code)
Increment the count of the number of requests against this connection.



isMarkedForDrop
public boolean isMarkedForDrop()(Code)
true if this connection is marked to be dropped outof the connection pool and closed.



prepareCall
public CallableStatement prepareCall(String sql) throws SQLException(Code)
Creates a CallableStatement object for calling database stored procedures. Refer to jdk api refernece.
Parameters:
  sql - The SQL statement to be called. a new CallableStatement object containing the pre-compiled SQL statement.
exception:
  java.sql.SQLException - If a database access error occursstatement.



prepareStatement
public PreparedStatement prepareStatement(String sql) throws SQLException(Code)
Get a prepared statement given an SQL string. If the statement is cached, return that statement, otherwise prepare and save in the cache.
Parameters:
  sql - The SQL statement to prepared. The prepared statement, which is associated only with thisconnection and must not be used once the connection is released.
exception:
  java.sql.SQLException - If a SQL error occured compiling thestatement.



release
public void release()(Code)
Return this connection to its allocator. This object should not be used after calling this function.



reset
public void reset() throws SQLException(Code)
Closes down all query-specific resources.
exception:
  java.sql.SQLException - If a database error occurs.



rollback
public void rollback() throws SQLException(Code)
Rollback a transaction. Should only be used when auto-commit mode has been disabled.
exception:
  SQLException - if a database access error occurs.



setAutoCommit
public void setAutoCommit(boolean on) throws SQLException(Code)
Autocommit on/off.
Parameters:
  on - false to disable auto commit mode. True to enable.
exception:
  SQLException - if a database access error occurs.



validate
public void validate() throws SQLException(Code)
Validates this connection. Check to see that it is not closed and has been properly allocated.
exception:
  java.sql.SQLException - If it is not valid.



warningCheck
public void warningCheck(ResultSet resultSet) throws SQLException(Code)
Check for warnings in a result set.
Parameters:
  resultSet - The result set to check for warnings.
exception:
  java.sql.SQLException - If a SQL error occured compiling thestatement.



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