Java Doc for DBTransaction.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.DBTransaction

DBTransaction
public interface DBTransaction (Code)
Used to perform database transactions.

Example - adding a new user:

 import org.enhydra.dods.DODS;
 import com.lutris.appserver.server.sql.*;
 DBTransaction transaction =
 DODS.getDatabaseManager().createTransaction(DATABASE_NAME);
 // NOTE: class CustomerDO implements Transaction { ... }
 // NOTE: An Object ID is automatically calculated by the constructor.
 CustomerDO customer = new CustomerDO();
 customer.setFirstName("Santa");
 customer.setLastName("Claus");
 // ... set all other CustomerFields ...
 //
 // Now add the new object to the database.
 //
 try {
 transaction.insert(customer);
 transaction.commit();
 System.out.println("Object ID is " + customer.get_OId());
 }
 catch (SQLException e) {
 transaction.rollback();
 throw e;
 }
 finally {
 transaction.release();
 }
 

author:
   Kyle Clark
since:
   LBS1.8
version:
   $Revision: 1.1 $




Method Summary
public  voidcommit()
     Method to commit upates.
public  DBQuerycreateQuery()
    
public  voiddelete(Transaction transaction)
     Method to delete an object in the database.
public  TransactiongetDO(Transaction transaction)
     Method find a DO in the transaction
Parameters:
  transaction - Object that implements transaction interface.
public  TransactiongetDO(Transaction transaction, int action)
    
public  StringgetDatabaseName()
    
public  booleanhandleException(SQLException e)
     Exception handeler.
public  voidinsert(Transaction transaction)
     Method to insert an object in the database.
public  voidlockDO(Transaction cdo)
    
public  booleanpreventCacheQueries()
    
public  voidrelease()
     Frees all resources consumed by this transaction Connections are returned to the connection pool. Subsequent transactions via this object, will allocate a new set of resources (i.e.
public  voidrollback()
     Method to rollback changes.
public  voidsetDatabaseName(String dbName)
    
public  voidupdate(Transaction transaction)
     Method to update an object in the database.
public  voidwrite()
    



Method Detail
commit
public void commit() throws SQLException(Code)
Method to commit upates.
exception:
  java.sql.SQLException - If a database access error occurs.



createQuery
public DBQuery createQuery() throws SQLException(Code)
Return a query for use with this TRANSACTION please!!! The query object.
exception:
  SQLException - if a SQL error occurs.



delete
public void delete(Transaction transaction)(Code)
Method to delete an object in the database.
Parameters:
  transaction - Object that implements transaction interface.



getDO
public Transaction getDO(Transaction transaction)(Code)
Method find a DO in the transaction
Parameters:
  transaction - Object that implements transaction interface. DO if the oid was in the transaction, null if it was notWebDocWf extension



getDO
public Transaction getDO(Transaction transaction, int action)(Code)
Method find a DO in the transaction
Parameters:
  transaction - Object that implements transaction interface.
Parameters:
  action - if not NONE=0, the DO is found only woth the matching action DO if the oid was in the transaction, null if it was notWebDocWf extension



getDatabaseName
public String getDatabaseName()(Code)
Method return name of used database name of used database



handleException
public boolean handleException(SQLException e)(Code)
Exception handeler. This object is should not be used for subsequent queries if this method returns false. boolean True if the exception can be handeledand the object is still valid, false otherwise.



insert
public void insert(Transaction transaction)(Code)
Method to insert an object in the database.
Parameters:
  transaction - Object that implements transaction interface.



lockDO
public void lockDO(Transaction cdo) throws SQLException(Code)



preventCacheQueries
public boolean preventCacheQueries()(Code)



release
public void release()(Code)
Frees all resources consumed by this transaction Connections are returned to the connection pool. Subsequent transactions via this object, will allocate a new set of resources (i.e. connection).



rollback
public void rollback() throws SQLException(Code)
Method to rollback changes.
exception:
  java.sql.SQLException - If a database access error occurs.



setDatabaseName
public void setDatabaseName(String dbName)(Code)
Method set name of used database
Parameters:
  dbName - name of used database



update
public void update(Transaction transaction)(Code)
Method to update an object in the database.
Parameters:
  transaction - Object that implements transaction interface.



write
public void write() throws SQLException(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.