Java Doc for GroupFetchScanController.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » store » access » 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 DBMS » db derby 10.2 » org.apache.derby.iapi.store.access 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.derby.iapi.store.access.GroupFetchScanController

GroupFetchScanController
public interface GroupFetchScanController extends GenericScanController(Code)
This scan controller can only be used for group fetch, no update operations are supported, use ScanController if you need scan interfaces other than group fetch.

In general group fetch will be more efficient than using the ScanController fetchNext() interface to get rows one at a time. The performance comes from reducing the per call overhead of getting a row. Also this interface can, depending on the requested isolation level, possibly do more efficient locking.

Group fetch scans are opened from a TransactionController.
See Also:   TransactionController.openScan
See Also:   RowCountable
See Also:   GenericScanController





Method Summary
public  intfetchNextGroup(DataValueDescriptor[][] row_array, RowLocation[] rowloc_array)
     Fetch the next N rows from the table.

The client allocates an array of N rows and passes it into the fetchNextSet() call.

public  intfetchNextGroup(DataValueDescriptor[][] row_array, RowLocation[] oldrowloc_array, RowLocation[] newrowloc_array)
    
 booleannext()
     Move to the next position in the scan.



Method Detail
fetchNextGroup
public int fetchNextGroup(DataValueDescriptor[][] row_array, RowLocation[] rowloc_array) throws StandardException(Code)
Fetch the next N rows from the table.

The client allocates an array of N rows and passes it into the fetchNextSet() call. The client must at least allocate a row and set row_array[0] to this row. The client can optionally either leave the rest of array entries null, or allocate rows to the slots. If access finds an entry to be null, and wants to read a row into it, it will allocate a row to the slot. Once fetchNextGroup() returns "ownership" of the row passes back to the client, access will not keep references to the allocated row. Expected usage is that the client will specify an array of some number (say 10), and then only allocate a single row. This way if only 1 row qualifies only one row will have been allocated.

This routine does the equivalent of N fetchNext() calls, filling in each of the rows in the array. Locking is performed exactly as if the N fetchNext() calls had been made.

It is up to Access how many rows to return. fetchNextGroup() will return how many rows were filled in. If fetchNextGroup() returns 0 then the scan is complete, (ie. the scan is in the same state as if fetchNext() had returned false). If the scan is not complete then fetchNext() will return (1 <= row_count <= N).

The current position of the scan is undefined if fetchNextSet() is used (ie. mixing fetch()/fetchNext() and fetchNextSet() calls in a single scan does not work). This is because a fetchNextSet() request for 5 rows from a heap where the first 2 rows qualify, but no other rows qualify will result in the scan being positioned at the end of the table, while if 5 rows did qualify the scan will be positioned on the 5th row.

If the row loc array is non-null then for each row fetched into the row array, a corresponding fetchLocation() call will be made to fill in the rowloc_array. This array, like the row array can be initialized with only one non-null RowLocation and access will allocate the rest on demand.

Qualifiers, start and stop positioning of the openscan are applied just as in a normal scan.

The columns of the row will be the standard columns returned as part of a scan, as described by the validColumns - see openScan for description.

Expected usage: // allocate an array of 5 empty rows DataValueDescriptor[][] row_array = allocate_row_array(5); int row_cnt = 0; scan = openScan(); while ((row_cnt = scan.fetchNextSet(row_array, null) != 0) { // I got "row_cnt" rows from the scan. These rows will be // found in row_array[0] through row_array[row_cnt - 1] }

The number of qualifying rows found and copied into the provided array of rows. If 0 then the scan is complete, otherwise the return value will be: 1 <= row_count <= row_array.length
Parameters:
  row_array - The array of rows to copy rows into. row_array[].length must >= 1. The first entrymust be non-null destination rows, other entriesmay be null and will be allocated by accessif needed.
Parameters:
  rowloc_array - If non-null, the array of row locations to copy into. If null, no row locations areretrieved.
exception:
  StandardException - Standard exception policy.




fetchNextGroup
public int fetchNextGroup(DataValueDescriptor[][] row_array, RowLocation[] oldrowloc_array, RowLocation[] newrowloc_array) throws StandardException(Code)



next
boolean next() throws StandardException(Code)
Move to the next position in the scan. If this is the first call to next(), the position is set to the first row. Returns false if there is not a next row to move to. It is possible, but not guaranteed, that this method could return true again, after returning false, if some other operation in the same transaction appended a row to the underlying conglomerate. True if there is a next position in the scan,false if there isn't.
exception:
  StandardException - Standard exception policy.



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