Java Doc for DbRowProcessor.java in  » Web-Framework » rife-1.6.1 » com » uwyn » rife » 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 » Web Framework » rife 1.6.1 » com.uwyn.rife.database 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.uwyn.rife.database.DbRowProcessor

All known Subclasses:   com.uwyn.rife.database.DbBeanFetcher,  com.uwyn.rife.authentication.sessionvalidators.ProcessSessionValidity,
DbRowProcessor
abstract public class DbRowProcessor implements Cloneable(Code)
This abstract base class should be used to implement classes that process one row in a database query resulset. The fetch method of a DbQueryManager requires an instance of a DbRowProcessor and calls its processRow method each time it is called.

The DbRowProcessor instance can then work with the result set and extract all needed data. It is free to implement any logic to be able to return the retrieved data in an acceptable form to the user.

A class that extends DbRowProcessor can for example take a Template instance as the argument of its constructor and progressively fill in each resulting row in a HTML table. This, without having to maintain the query results in memory to be able to provide it to a seperate method which is responsible for the handling of the output. Using a DbRowProcessor thus allows for perfect seperation and abstraction of result processing without having to be burdened with possible large memory usage or large object allocation.
author:
   Geert Bevin (gbevin[remove] at uwyn dot com)
version:
   $Revision: 3634 $
See Also:   DbRowProcessor.processRow(ResultSet resultSet)
See Also:   com.uwyn.rife.database.DbQueryManager
since:
   1.0





Method Summary
public  Objectclone()
     Simply clones the instance with the default clone method since this class contains no object member variables.
abstract public  booleanprocessRow(ResultSet resultSet)
     This method has to be implemented by each class that extends the DbRowProcessor class.
final  voidprocessRowWrapper(ResultSet resultSet)
     This method wraps around the actual DbRowProcessor.processRow(ResultSet) method to ensure that the success status is reset at each iteration and that the possible SQLExceptions are caught correctly.

This is the method that's called internally by the fetch() method of a DbQueryManager.

final public  booleanwasSuccessful()
     Indicates whether the processing of the row was successful.



Method Detail
clone
public Object clone()(Code)
Simply clones the instance with the default clone method since this class contains no object member variables.
since:
   1.0



processRow
abstract public boolean processRow(ResultSet resultSet) throws SQLException(Code)
This method has to be implemented by each class that extends the DbRowProcessor class. It has to contain all the logic that should be executed for each row of a resultset.
Parameters:
  resultSet - the ResultSet instance that was provided tothe DbQueryManager's fetch method. true if the processing is considered successful; or

false if the processing is considered failed.

Note: this return value is purely indicative and unless the user doeschecks with the wasSuccessful() method, it will have noinfluence on anything.
throws:
  SQLException - when a database error occurs, it's thus notnecessary to catch all the possible SQLExceptions insidethis method. They'll be caught higher up and be transformed inDatabaseExceptions.
See Also:   DbQueryManager.fetch(ResultSetDbRowProcessor)
See Also:   DbRowProcessor.wasSuccessful()
since:
   1.0




processRowWrapper
final void processRowWrapper(ResultSet resultSet) throws DatabaseException(Code)
This method wraps around the actual DbRowProcessor.processRow(ResultSet) method to ensure that the success status is reset at each iteration and that the possible SQLExceptions are caught correctly.

This is the method that's called internally by the fetch() method of a DbQueryManager. It is not meant to be used by the user.
Parameters:
  resultSet - a ResultSet instance that was returnedafter a query's execution.
throws:
  DatabaseException - when a database access error occurred duringthe processing of the resultset row
See Also:   DbRowProcessor.processRow(ResultSet)
See Also:   DbQueryManager.fetch(ResultSetDbRowProcessor)
since:
   1.0




wasSuccessful
final public boolean wasSuccessful()(Code)
Indicates whether the processing of the row was successful. true if the processing was successful; or

false if the processing was unsuccessful.
since:
   1.0




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.