Source Code Cross Referenced 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 Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Enhydra Java Application Server Project
003:         *
004:         * The contents of this file are subject to the Enhydra Public License
005:         * Version 1.1 (the "License"); you may not use this file except in
006:         * compliance with the License. You may obtain a copy of the License on
007:         * the Enhydra web site ( http://www.enhydra.org/ ).
008:         *
009:         * Software distributed under the License is distributed on an "AS IS"
010:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
011:         * the License for the specific terms governing rights and limitations
012:         * under the License.
013:         *
014:         * The Initial Developer of the Enhydra Application Server is Lutris
015:         * Technologies, Inc. The Enhydra Application Server and portions created
016:         * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
017:         * All Rights Reserved.
018:         *
019:         * Contributor(s):
020:         *
021:         * $Id: DBTransaction.java,v 1.1 2007-01-24 16:59:09 sinisa Exp $
022:         *
023:         * formatted with JxBeauty (c) johann.langhofer@nextra.at
024:         */
025:        package com.lutris.appserver.server.sql;
026:
027:        import java.sql.SQLException;
028:
029:        /**
030:         * Used to perform database transactions.
031:         *
032:         * <P>Example - adding a new user:
033:         * <PRE>
034:         * 	 import org.enhydra.dods.DODS;
035:         * 	 import com.lutris.appserver.server.sql.*;
036:         *
037:         *       DBTransaction transaction =
038:         *       	DODS.getDatabaseManager().createTransaction(DATABASE_NAME);
039:         *
040:         *       // NOTE: class CustomerDO implements Transaction { ... }
041:         *       // NOTE: An Object ID is automatically calculated by the constructor.
042:         *       CustomerDO customer = new CustomerDO();
043:         *       customer.setFirstName("Santa");
044:         *       customer.setLastName("Claus");
045:         *
046:         *       // ... set all other CustomerFields ...
047:         *
048:         *       //
049:         *       // Now add the new object to the database.
050:         *       //
051:         *       try {
052:         *           transaction.insert(customer);
053:         *           transaction.commit();
054:         *           System.out.println("Object ID is " + customer.get_OId());
055:         *       }
056:         *       catch (SQLException e) {
057:         *           transaction.rollback();
058:         *           throw e;
059:         *       }
060:         *       finally {
061:         *           transaction.release();
062:         *       }
063:         * </PRE>
064:         *
065:         * @author	Kyle Clark
066:         * @since	LBS1.8
067:         * @version	$Revision: 1.1 $
068:         */
069:        public interface DBTransaction {
070:
071:            /**
072:             * Method to update an object in the database.
073:             *
074:             * @param transaction
075:             *   Object that implements transaction interface.
076:             */
077:            public void update(Transaction transaction);
078:
079:            /**
080:             * Method to delete an object in the database.
081:             *
082:             * @param transaction
083:             *   Object that implements transaction interface.
084:             */
085:            public void delete(Transaction transaction);
086:
087:            /**
088:             * Method to insert an object in the database.
089:             *
090:             * @param transaction
091:             *   Object that implements transaction interface.
092:             */
093:            public void insert(Transaction transaction);
094:
095:            /**
096:             * Method to commit upates.
097:             *
098:             * @exception java.sql.SQLException If a database access error occurs.
099:             */
100:            public void commit() throws SQLException;
101:
102:            /**
103:             * Method to rollback changes.
104:             *
105:             * @exception java.sql.SQLException
106:             *   If a database access error occurs.
107:             */
108:            public void rollback() throws SQLException;
109:
110:            /**
111:             * Frees all resources consumed by this transaction
112:             * Connections are returned to the connection pool.
113:             * Subsequent transactions via this object,
114:             * will allocate a new set of resources (i.e. connection).
115:             */
116:            public void release();
117:
118:            /**
119:             * Exception handeler.  This object is should not be
120:             * used for subsequent queries if this method returns
121:             * false.
122:             *
123:             * @return boolean True if the exception can be handeled
124:             *   and the object is still valid, false otherwise.
125:             */
126:            public boolean handleException(SQLException e);
127:
128:            // compliance with WEBDOCWF begin
129:            /**
130:             * Method find a DO in the transaction
131:             *
132:             * @param transaction
133:             *   Object that implements transaction interface.
134:             * @return DO if the oid was in the transaction, null if it was not
135:             *
136:             * WebDocWf extension
137:             */
138:            public Transaction getDO(Transaction transaction);
139:
140:            /**
141:             * Method find a DO in the transaction
142:             *
143:             * @param transaction
144:             *   Object that implements transaction interface.
145:             * @param action
146:             *   if not NONE=0, the DO is found only woth the matching action
147:             * @return DO if the oid was in the transaction, null if it was not
148:             *
149:             * WebDocWf extension
150:             */
151:            public Transaction getDO(Transaction transaction, int action);
152:
153:            // original line
154:            //
155:            // compliance with WEBDOCWF end
156:
157:            /**
158:             * Method return name of used database
159:             *
160:             * @return name of used database
161:             */
162:            public String getDatabaseName();
163:
164:            /**
165:             * Method set name of used database
166:             *
167:             * @param dbName name of used database
168:             */
169:            public void setDatabaseName(String dbName);
170:
171:            /**
172:             *
173:             */
174:            public void write() throws SQLException;
175:
176:            /**
177:             *
178:             */
179:            public void lockDO(Transaction cdo) throws SQLException;
180:
181:            /**
182:             * Return a query for use with this TRANSACTION please!!!
183:             *
184:             * @return The query object.
185:             * @exception SQLException
186:             *   if a SQL error occurs.
187:             */
188:            public DBQuery createQuery() throws SQLException;
189:
190:            /**
191:             *
192:             */
193:            public boolean preventCacheQueries();
194:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.