Java Doc for ResultSetRenderer.java in  » Database-Client » iSQL-Viewer » org » isqlviewer » 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 » Database Client » iSQL Viewer » org.isqlviewer.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.isqlviewer.sql.ResultSetRenderer

All known Subclasses:   org.isqlviewer.util.NullResultSetViewer,  org.isqlviewer.ui.TabbedResultsetRenderer,
ResultSetRenderer
public interface ResultSetRenderer (Code)
Protocol for defining a client that can render results from an JDBC command execution.


author:
   Mark A. Kobold <mkobold at isqlviewer dot com>
version:
   1.0





Method Summary
public  voidfinalizeStatement(String stmtID)
     handler if the statement has been interrupted or cancelled.
public  voidhandleSQLException(SQLException e)
     Delegates an SQLException from a given ResultSet.
public  voidinitialize()
     Basic initialization method to allocate resource prior to executing a query.
public  booleanisCancelled()
    
public  voidprocessGeneratedKeys(String stmtID, ResultSet keys, String nativeSQL)
     Process generated keys result set after initial result set is processed.

If this ResultSetViewer supports processing generated keys, this method should called if and only the statement provides generated keys resultset.

public  longprocessResultSet(String stmtID, ResultSet set, String nativeSQL, int count)
     Processes ResultSet objects from a statement execution.

This is the common method for dispatching a result set for processing outside the database connection object. Once a Statement has executed and has results this method will be invoked.

public  voidprocessRowUpdates(String stmtID, int updateCount, String nativeSQL)
     Processes row updates from a statement execution.
public  voidrecieveResultsetWarnings(ResultSet set, SQLWarning warnings)
     Delegates SQLWarnings from the given ResultSet to be handled.
public  voidrecieveStatementWarnings(Statement stmt, SQLWarning warnings)
     Statement warnings from a resultset can be delegated here.
public  voidstatementInitialized(String stmtID, Statement statement)
     Notifcation that the a statement object has been created and is ready to execute.

Simple callback method for indicating that the Statement object has been created and will be executing shortly after this method.

public  StringsubstituteVariable(String variableName)
     Allows the renderer to substitute the variable by name with something else.

When an SQL Statement is executed and inline variables in the Jav variable form of ${variable.name} are detect the SQL executor will request a substitution for the variable name.
Parameters:
  variableName - to substitute.

public  booleansupportsGeneratedKeys()
     Determines if this object wants to view generated keys.

If this method returns true, a second call should be made to processGeneratedKeys so that the can be properly handled.

public  booleansupportsUpdateableResultSets()
     Determining if this resultset viewer can edit updatable resultsets.

If a ResultSet is deemed updateable and this method returns true, then the DatabaseConnection object will not automatically close the resultset when it is done processing it.




Method Detail
finalizeStatement
public void finalizeStatement(String stmtID)(Code)
handler if the statement has been interrupted or cancelled.

if an error occurs in the realm that the statement execution was interuppted threading wise or through the use of the cancel method on the statement this method will be used to indicate that the statement was interrupted and no further processing will be be executed on the statement.

Implementations can use the statement identifier to clean up and resources if nessecary, no further calls to this object should be made with the given statement ID, if so exceptions should be thrown.
Parameters:
  stmtID - unqiue identifier for the statement that was cancelled.




handleSQLException
public void handleSQLException(SQLException e)(Code)
Delegates an SQLException from a given ResultSet.

If performing some processing of the given ResultSet, results with an SQLException, than it should be delegated here.

Code may send a null ResultSet to indicate a general SQLException.
Parameters:
  set - ResultSet as the source of the Exception, can be null.
Parameters:
  e - Exception that has occured.




initialize
public void initialize()(Code)
Basic initialization method to allocate resource prior to executing a query.




isCancelled
public boolean isCancelled()(Code)



processGeneratedKeys
public void processGeneratedKeys(String stmtID, ResultSet keys, String nativeSQL)(Code)
Process generated keys result set after initial result set is processed.

If this ResultSetViewer supports processing generated keys, this method should called if and only the statement provides generated keys resultset. Like the other methods implementations are not required to close the resultset, the invoking code should close the resultset after this method is closed.

A Side note that the generated keys is a JDBC 3.0 feature so make sure that the JDBC driver has been updated to be uses in the JDK 1.4.x+ runtimes as the JDK 1.4.x runtimes support the JDBC 3.0 specification.
See Also:   ResultSetRenderer.supportsGeneratedKeys()
See Also:   Statement.getGeneratedKeys
Parameters:
  nativeSQL - SQL statement that the keys originated from.
Parameters:
  stmtID - unique identifier for this statement.
Parameters:
  keys - generated keys as a result of the previous resultset.




processResultSet
public long processResultSet(String stmtID, ResultSet set, String nativeSQL, int count)(Code)
Processes ResultSet objects from a statement execution.

This is the common method for dispatching a result set for processing outside the database connection object. Once a Statement has executed and has results this method will be invoked. Implementations are not required to nor are they encouraged to close the resultset as the code calling this method should ensure that the resultset is closed properly. If the statement is returning multiple resultsets this method will be called for each resultset recieved. The exception for closing ResultSets is described in the supportsUpdateableResultSets() method.

The count parameter is for convience to indicate which resultset this is in a series of resultsets, if the statement is returning only one resultset or is executing a single statement the count should always be 0. There are situations where multiple queries can be executed in a single statement the count parameter in this situation will also represent the resultset count in the series.
See Also:   ResultSetRenderer.supportsUpdateableResultSets()
See Also:   Statement.getResultSet
Parameters:
  nativeSQL - SQL that created the given ResultSet.
Parameters:
  stmtID - unique identifier for this statement.
Parameters:
  set - ResultSet returned from the statement's execution.
Parameters:
  count - in the situation of multiple resultsets this will be a counter for the resultset. number of rows processed from the result set.




processRowUpdates
public void processRowUpdates(String stmtID, int updateCount, String nativeSQL)(Code)
Processes row updates from a statement execution.

If a Statement execution does not return any resultsets then it most likely was an UPDATE or something similar. This allows for notification for the that update count returned by the statement.
See Also:   Statement.getUpdateCount
Parameters:
  nativeSQL - the SQL that created the update count.
Parameters:
  stmtID - unique identifier for the executing statement.
Parameters:
  updateCount - the update count as a result of statement execution.




recieveResultsetWarnings
public void recieveResultsetWarnings(ResultSet set, SQLWarning warnings)(Code)
Delegates SQLWarnings from the given ResultSet to be handled.

Any code that invokes this method should clear all warnings from the given ResultSet to help insure that the same warning is not processed more than it needs to be.
Parameters:
  set - ResultSet source where the given warnings came from.
Parameters:
  warnings - detected from the given resultset.




recieveStatementWarnings
public void recieveStatementWarnings(Statement stmt, SQLWarning warnings)(Code)
Statement warnings from a resultset can be delegated here.

Any code that invokes this method should clear all warnings from the given Statement to help insure that the same warning is not processed more than it needs to be.
Parameters:
  stmt - Source statement object the warnings are coming from.
Parameters:
  warnings - from a statement.




statementInitialized
public void statementInitialized(String stmtID, Statement statement)(Code)
Notifcation that the a statement object has been created and is ready to execute.

Simple callback method for indicating that the Statement object has been created and will be executing shortly after this method. Implementations can use the stmtID for ensuring each resultset is processed correctly, if implementation are responding to multiple statement executions.
Parameters:
  stmtID - unique identifier for the statement currently executing.




substituteVariable
public String substituteVariable(String variableName)(Code)
Allows the renderer to substitute the variable by name with something else.

When an SQL Statement is executed and inline variables in the Jav variable form of ${variable.name} are detect the SQL executor will request a substitution for the variable name.
Parameters:
  variableName - to substitute. the value to be substituted for the given variable name.




supportsGeneratedKeys
public boolean supportsGeneratedKeys()(Code)
Determines if this object wants to view generated keys.

If this method returns true, a second call should be made to processGeneratedKeys so that the can be properly handled. Note if there are no generated keys and or they are supported for a paticular JDBC platform.

You can check support for generated keys through the DatabaseMetaData object.
See Also:   java.sql.DatabaseMetaData.supportsGetGeneratedKeys true to process generated keys or not process them.




supportsUpdateableResultSets
public boolean supportsUpdateableResultSets()(Code)
Determining if this resultset viewer can edit updatable resultsets.

If a ResultSet is deemed updateable and this method returns true, then the DatabaseConnection object will not automatically close the resultset when it is done processing it. This allows this object to keeps a reference to it and provide updates to the Resultset as needed.

If the ResultSet is not updatable or the statement is generating multiple results then the value returned here will be ignored as with multiple resultsets it says in the JDBC API that one and only one resultset should be open per statement object. so with that if multiple results are being returned all results will be automatically closed.

Since the resultset is not automatically closed, it is strongly encouraged that extra steps are taken to ensure that a resultset is closed, as open resultsets can cause erratic problems on certain JDBC platforms. if this object can perform updates on the ResultSet.




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