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


org.apache.derby.iapi.sql.Activation

All known Subclasses:   org.apache.derby.impl.sql.GenericActivationHolder,
Activation
public interface Activation (Code)
An activation contains all the local state information necessary to execute a re-entrant PreparedStatement. The way it will actually work is that a PreparedStatement will have an executable plan, which will be a generated class. All of the local state will be variables in the class. Creating a new instance of the executable plan will create the local state variables. This means that an executable plan must implement this interface, and that the PreparedStatement.getActivation() method will do a "new" operation on the executable plan.

The fixed implementations of Activation in the Execution impl package are used as skeletons for the classes generated for statements when they are compiled.

There are no fixed implementations of Activation for statements; a statement has an activation generated for it when it is compiled.
author:
   Jeff Lichtman





Method Summary
 voidaddWarning(SQLWarning w)
    
public  booleancheckIfThisActivationHasHoldCursor(String tableName)
     Temporary tables can be declared with ON COMMIT DELETE ROWS.
public  voidcheckStatementValidity()
     Check the validity of the current executing statement.
 voidclearCurrentRow(int resultSetNumber)
     Generated plans have a current row field for ease in defining the methods and finding them dynamically.
public  voidclearHeapConglomerateController()
     Clear the ConglomerateController to be used for an update or delete.
public  voidclearIndexScanInfo()
     Clear the info for the index to be re-used for update/delete.
public  voidclearParentResultSets()
    
 voidclearResultSet()
     Sets the ResultSet to be returned by getResultSet() to null.
 voidclearWarnings()
     Clear the activation's warnings.
 voidclose()
     Closing an activation statement marks it as unusable.
 ResultSetexecute()
     When the prepared statement is executed, it passes execution on to the activation execution was requested for.
public  int[]getAutoGeneratedKeysColumnIndexes()
     Returns the column positions array of columns requested in auto-generated keys resultset for this avtivation.
public  String[]getAutoGeneratedKeysColumnNames()
     Returns the column names array of columns requested in auto-generated keys resultset for this avtivation.
public  booleangetAutoGeneratedKeysResultsetMode()
     Returns true if auto-generated keys resultset request was made for this avtivation.
public  ConstantActiongetConstantAction()
    
public  StringgetCursorName()
     Return the cursor name of this activation.
public  TableDescriptorgetDDLTableDescriptor()
     Get the TableDescriptor for the target of DDL.
 DataValueFactorygetDataValueFactory()
    
public  java.sql.ResultSet[][]getDynamicResults()
     Return the set of dynamical created result sets, for procedures. Base implementation returns null, a generated class for a procedure overwrites this with a real implementation. null if no dynamic results exists.
 ExecutionFactorygetExecutionFactory()
    
public  booleangetForCreateTable()
     Get whether or not this activation is for create table.
public  CursorResultSetgetForUpdateIndexScan()
    
public  ConglomerateControllergetHeapConglomerateController()
     Get the ConglomerateController, if any, that has already been opened for the heap when scaning for an update or delete.
public  longgetIndexConglomerateNumber()
     Get the conglomerate number of the index, if any, that has already been opened for scaning for an update or delete.
public  ScanControllergetIndexScanController()
     Get the ScanController, if any, that has already been opened for the index when scaning for an update or delete.
public  LanguageConnectionContextgetLanguageConnectionContext()
    
public  intgetMaxDynamicResults()
     Return the maximum number of dynamical created result sets from the procedure definition.
public  intgetMaxRows()
     Get the maximum # of rows.
public  intgetNumSubqueries()
     Get the number of subqueries in the entire query.
 ParameterValueSetgetParameterValueSet()
     Gets the ParameterValueSet for this execution of the statement. The ParameterValueSet for this execution of thestatement.
public  VectorgetParentResultSet(String resultSetId)
     get the reference to parent table ResultSets, that will be needed by the referential action dependent table scans.
public  HashtablegetParentResultSets()
    
 ExecPreparedStatementgetPreparedStatement()
     Get the prepared statement that this activation is for.
 ResultDescriptiongetResultDescription()
     Get the result description for this activation, if it has one.
 ResultSetgetResultSet()
     Returns the current result set for this activation, i.e. the one returned by the last execute() call.
public  booleangetResultSetHoldability()
     Return the holdability of this activation.
public  RowLocationgetRowLocationTemplate(int itemNumber)
     Get the saved RowLocation.
public  java.sql.ResultSetgetTargetVTI()
     Get the ResultSet for the target of an update/delete to a VTI.
 TransactionControllergetTransactionController()
     Get the Execution TransactionController associated with this activation/lcc.
 SQLWarninggetWarnings()
     Returns the chained list of warnings.
public  voidinformOfRowCount(NoPutResultSet resultSet, long rowCount)
     Tell this activation that the given ResultSet was found to have the given number of rows.
 booleanisClosed()
     Find out if the activation is closed or not.
public  booleanisCursorActivation()
    
public  booleanisInUse()
    
 booleanisSingleExecution()
     Returns true if this Activation is only going to be used for one execution.
public  voidmarkUnused()
     Mark the activation as unused.
 voidreset()
     Resets the activation to the "pre-execution" state - that is, the state where it can be used to begin a new execution.
public  voidsetAutoGeneratedKeysResultsetInfo(int[] columnIndexes, String[] columnNames)
     Set the auto-generated keys resultset mode to true for this activation. The specific columns for auto-generated keys resultset can be requested by passing column positions array The specific columns for auto-generated keys resultset can be requested by passing column names array Both the parameters would be null if user didn't request specific keys. Otherwise, the user could request specific columns by passing column positions or names array but not both.
Parameters:
  columnIndexes - Request specific columns in auto-generated keysresultset by passing column positions.
 voidsetCurrentRow(ExecRow currentRow, int resultSetNumber)
     Generated plans have a current row field for ease in defining the methods and finding them dynamically.
 voidsetCursorName(String cursorName)
     JDBC requires that all select statements be converted into cursors, and that the cursor name be settable for each execution of a select statement.
public  voidsetDDLTableDescriptor(TableDescriptor td)
     Save the TableDescriptor for the target of DDL so that it can be passed between the various ConstantActions during execution.
public  voidsetForCreateTable()
     Mark the Activation as being for create table.
public  voidsetForUpdateIndexScan(CursorResultSet forUpdateResultSet)
     beetle 3865: updateable cursor using index.
public  voidsetHeapConglomerateController(ConglomerateController updateHeapCC)
     Set the ConglomerateController to be used for an update or delete.
public  voidsetIndexConglomerateNumber(long indexConglomerateNumber)
    
public  voidsetIndexScanController(ScanController indexSC)
    
public  voidsetMaxRows(int maxRows)
     Set the maximum # of rows.
 voidsetParameters(ParameterValueSet parameterValues, DataTypeDescriptor[] parameterTypes)
     Sets the parameter values for this execution of the statement.

Has no effect if the activation has been closed.

NOTE: The setParameters() method is currently unimplemented.

public  voidsetParentResultSet(TemporaryRowHolder rs, String resultSetId)
    
public  voidsetResultSetHoldability(boolean resultSetHoldability)
     Set current resultset holdability.
 voidsetSingleExecution()
     Set this Activation for a single execution. E.g.
public  voidsetTargetVTI(java.sql.ResultSet targetVTI)
     Save the ResultSet for the target of an update/delete to a VTI.



Method Detail
addWarning
void addWarning(SQLWarning w)(Code)
Add a warning to the activation



checkIfThisActivationHasHoldCursor
public boolean checkIfThisActivationHasHoldCursor(String tableName)(Code)
Temporary tables can be declared with ON COMMIT DELETE ROWS. But if the table has a held curosr open at commit time, data should not be deleted from the table. This method, (gets called at commit time) checks if this activation held cursor and if so, does that cursor reference the passed temp table name. true if this activation has held cursor and if it references the passed temp table name



checkStatementValidity
public void checkStatementValidity() throws StandardException(Code)
Check the validity of the current executing statement. Needs to be called after a statement has obtained the relevant table locks on the



clearCurrentRow
void clearCurrentRow(int resultSetNumber)(Code)
Generated plans have a current row field for ease in defining the methods and finding them dynamically. The interface is used to set the row before a dynamic method that uses it is invoked.

When all processing on the currentRow has been completed, callers should call activation.clearCurrentRow(resultSetNumber) to ensure that no unnecessary references are retained to rows. This will allow the rows no longer in use to be collected by the garbage collecter.
Parameters:
  resultSetNumber - The resultSetNumber for the current ResultSet




clearHeapConglomerateController
public void clearHeapConglomerateController()(Code)
Clear the ConglomerateController to be used for an update or delete. (Saves opening the ConglomerateController twice.)



clearIndexScanInfo
public void clearIndexScanInfo()(Code)
Clear the info for the index to be re-used for update/delete. (ScanController and conglomerate number.)



clearParentResultSets
public void clearParentResultSets()(Code)



clearResultSet
void clearResultSet()(Code)
Sets the ResultSet to be returned by getResultSet() to null.



clearWarnings
void clearWarnings()(Code)
Clear the activation's warnings.



close
void close() throws StandardException(Code)
Closing an activation statement marks it as unusable. Any other requests made on it will fail. An activation should be marked closed when it is expected to not be used any longer, i.e. when the connection for it is closed, or it has suffered some sort of severe error. This will also close its result set and release any resources it holds e.g. for parameters.

Any class that implements this must be prepared to be executed from garbage collection, ie. there is no matching context stack.
exception:
  StandardException - Thrown on failure




execute
ResultSet execute() throws StandardException(Code)
When the prepared statement is executed, it passes execution on to the activation execution was requested for. the ResultSet for further manipulation, if any.
exception:
  StandardException - Thrown on failure



getAutoGeneratedKeysColumnIndexes
public int[] getAutoGeneratedKeysColumnIndexes()(Code)
Returns the column positions array of columns requested in auto-generated keys resultset for this avtivation. Returns null if no specific column requested by positions

column positions array of columns requested.




getAutoGeneratedKeysColumnNames
public String[] getAutoGeneratedKeysColumnNames()(Code)
Returns the column names array of columns requested in auto-generated keys resultset for this avtivation. Returns null if no specific column requested by names

column names array of columns requested.




getAutoGeneratedKeysResultsetMode
public boolean getAutoGeneratedKeysResultsetMode()(Code)
Returns true if auto-generated keys resultset request was made for this avtivation.

auto-generated keys resultset mode for this activation.




getConstantAction
public ConstantAction getConstantAction()(Code)



getCursorName
public String getCursorName()(Code)
Return the cursor name of this activation. This will differ from its ResultSet's cursor name if it has been altered with setCursorName. Thus this always returns the cursor name of the next execution of this activation. The cursor name of the current execution must be obtained from the ResultSet. or this.getResultSet.getCursorName() [with null checking].

Statements that do not support cursors will return a null.

The cursor name.




getDDLTableDescriptor
public TableDescriptor getDDLTableDescriptor()(Code)
Get the TableDescriptor for the target of DDL. The TableDescriptor for the target ofDDL.



getDataValueFactory
DataValueFactory getDataValueFactory()(Code)
Get the DataValueFactory DataValueFactory



getDynamicResults
public java.sql.ResultSet[][] getDynamicResults()(Code)
Return the set of dynamical created result sets, for procedures. Base implementation returns null, a generated class for a procedure overwrites this with a real implementation. null if no dynamic results exists. Otherwise an array of ResultSetarrays, each of length one containing null or a reference to a ResultSet.



getExecutionFactory
ExecutionFactory getExecutionFactory()(Code)
Get the ExecutionFactory ExecutionFactory



getForCreateTable
public boolean getForCreateTable()(Code)
Get whether or not this activation is for create table. (NOTE: We can do certain optimizations for create table that we can't do for other DDL.) Whether or not this activation is forcreate table.



getForUpdateIndexScan
public CursorResultSet getForUpdateIndexScan()(Code)



getHeapConglomerateController
public ConglomerateController getHeapConglomerateController()(Code)
Get the ConglomerateController, if any, that has already been opened for the heap when scaning for an update or delete. (Saves opening the ConglomerateController twice.) The ConglomerateController, if available, to use for the update.



getIndexConglomerateNumber
public long getIndexConglomerateNumber()(Code)
Get the conglomerate number of the index, if any, that has already been opened for scaning for an update or delete. (Saves opening the ScanController twice.) The conglomerate number, if available, to use for the update.



getIndexScanController
public ScanController getIndexScanController()(Code)
Get the ScanController, if any, that has already been opened for the index when scaning for an update or delete. (Saves opening the ScanController twice.) The ScanController, if available, to use for the update.



getLanguageConnectionContext
public LanguageConnectionContext getLanguageConnectionContext()(Code)
Get the language connection context associated with this activation



getMaxDynamicResults
public int getMaxDynamicResults()(Code)
Return the maximum number of dynamical created result sets from the procedure definition. Base implementation returns 0, a generated class for a procedure overwrites this with a real implementation.



getMaxRows
public int getMaxRows()(Code)
Get the maximum # of rows. (# of rows that can be returned by a ResultSet. 0 means no limit.) Maximum # of rows. (0 means no limit.)



getNumSubqueries
public int getNumSubqueries()(Code)
Get the number of subqueries in the entire query. int The number of subqueries in the entire query.



getParameterValueSet
ParameterValueSet getParameterValueSet()(Code)
Gets the ParameterValueSet for this execution of the statement. The ParameterValueSet for this execution of thestatement. Returns NULL if there are no parameters.



getParentResultSet
public Vector getParentResultSet(String resultSetId)(Code)
get the reference to parent table ResultSets, that will be needed by the referential action dependent table scans.



getParentResultSets
public Hashtable getParentResultSets()(Code)



getPreparedStatement
ExecPreparedStatement getPreparedStatement()(Code)
Get the prepared statement that this activation is for. the prepared statement this activation is for.



getResultDescription
ResultDescription getResultDescription()(Code)
Get the result description for this activation, if it has one. result description for this activation, if it has one;otherwise, null.



getResultSet
ResultSet getResultSet()(Code)
Returns the current result set for this activation, i.e. the one returned by the last execute() call. If there has been no execute call or the activation has been reset or closed, a null is returned. the current ResultSet of this activation.



getResultSetHoldability
public boolean getResultSetHoldability()(Code)
Return the holdability of this activation.

The holdability of this activation.




getRowLocationTemplate
public RowLocation getRowLocationTemplate(int itemNumber)(Code)
Get the saved RowLocation.
Parameters:
  itemNumber - The saved item number. A RowLocation template for the conglomerate



getTargetVTI
public java.sql.ResultSet getTargetVTI()(Code)
Get the ResultSet for the target of an update/delete to a VTI. The ResultSet for the targetof an update/delete to a VTI.



getTransactionController
TransactionController getTransactionController()(Code)
Get the Execution TransactionController associated with this activation/lcc.



getWarnings
SQLWarning getWarnings()(Code)
Returns the chained list of warnings. Returns null if there are no warnings.



informOfRowCount
public void informOfRowCount(NoPutResultSet resultSet, long rowCount) throws StandardException(Code)
Tell this activation that the given ResultSet was found to have the given number of rows. This is used during execution to determine whether a table has grown or shrunk. If a table's size changes significantly, the activation may invalidate its PreparedStatement to force recompilation. Note that the association of row counts with ResultSets is kept in the activation class, not in the activation itself. This means that this method must be synchronized. This method is not required to check the number of rows on each call. Because of synchronization, this check is likely to be expensive, so it may only check every hundred calls or so.
exception:
  StandardException - Thrown on error



isClosed
boolean isClosed()(Code)
Find out if the activation is closed or not. true if the Activation has been closed.



isCursorActivation
public boolean isCursorActivation()(Code)
Is this Activation for a cursor? Whether or not this Activation is for a cursor.



isInUse
public boolean isInUse()(Code)
Is the activation in use? true/false



isSingleExecution
boolean isSingleExecution()(Code)
Returns true if this Activation is only going to be used for one execution.



markUnused
public void markUnused()(Code)
Mark the activation as unused.



reset
void reset() throws StandardException(Code)
Resets the activation to the "pre-execution" state - that is, the state where it can be used to begin a new execution. Frees local buffers, stops scans, resets counters to zero, sets current date and time to an unitialized state, etc.
exception:
  StandardException - thrown on failure



setAutoGeneratedKeysResultsetInfo
public void setAutoGeneratedKeysResultsetInfo(int[] columnIndexes, String[] columnNames)(Code)
Set the auto-generated keys resultset mode to true for this activation. The specific columns for auto-generated keys resultset can be requested by passing column positions array The specific columns for auto-generated keys resultset can be requested by passing column names array Both the parameters would be null if user didn't request specific keys. Otherwise, the user could request specific columns by passing column positions or names array but not both.
Parameters:
  columnIndexes - Request specific columns in auto-generated keysresultset by passing column positions. null means no specific columnsrequested by position
Parameters:
  columnNames - Request specific columns in auto-generated keysresultset by passing column names. null means no specific columnsrequested by position



setCurrentRow
void setCurrentRow(ExecRow currentRow, int resultSetNumber)(Code)
Generated plans have a current row field for ease in defining the methods and finding them dynamically. The interface is used to set the row before a dynamic method that uses it is invoked.

When all processing on the currentRow has been completed, callers should call activation.clearCurrentRow(resultSetNumber) to ensure that no unnecessary references are retained to rows. This will allow the rows no longer in use to be collected by the garbage collecter.
Parameters:
  currentRow - The row to be operated upon.
Parameters:
  resultSetNumber - The resultSetNumber for the current ResultSet




setCursorName
void setCursorName(String cursorName)(Code)
JDBC requires that all select statements be converted into cursors, and that the cursor name be settable for each execution of a select statement. The Language Module will support this, so that the JDBC driver will not have to parse JSQL text. This method will have no effect when called on non-select statements.

There will be a JSQL statement to disable the "cursorization" of all select statements. For non-cursorized select statements, this method will have no effect.

This has no effect if the activation has been closed.


Parameters:
  cursorName - The cursor name to use.




setDDLTableDescriptor
public void setDDLTableDescriptor(TableDescriptor td)(Code)
Save the TableDescriptor for the target of DDL so that it can be passed between the various ConstantActions during execution.



setForCreateTable
public void setForCreateTable()(Code)
Mark the Activation as being for create table. (NOTE: We can do certain optimizations for create table that we can't do for other DDL.)



setForUpdateIndexScan
public void setForUpdateIndexScan(CursorResultSet forUpdateResultSet)(Code)
beetle 3865: updateable cursor using index. A way of communication between cursor activation and update activation.



setHeapConglomerateController
public void setHeapConglomerateController(ConglomerateController updateHeapCC)(Code)
Set the ConglomerateController to be used for an update or delete. (Saves opening the ConglomerateController twice.)
Parameters:
  updateHeapCC - The ConglomerateController to reuse for the update or delete.



setIndexConglomerateNumber
public void setIndexConglomerateNumber(long indexConglomerateNumber)(Code)
Set the conglomerate number of the index to be used for an update or delete, when scanning an index that will also be updated (Saves opening the ScanController twice.)
Parameters:
  indexConglomerateNumber - The conglomerate number of the index to reuse for the update or delete.



setIndexScanController
public void setIndexScanController(ScanController indexSC)(Code)
Set the ScanController to be used for an update or delete, when scanning an index that will also be updated (Saves opening the ScanController twice.)
Parameters:
  indexSC - The ScanController to reuse for the update or delete.



setMaxRows
public void setMaxRows(int maxRows)(Code)
Set the maximum # of rows. (# of rows that can be returned by a ResultSet. 0 means no limit.)
Parameters:
  maxRows - Maximum # of rows. (0 means no limit.)



setParameters
void setParameters(ParameterValueSet parameterValues, DataTypeDescriptor[] parameterTypes) throws StandardException(Code)
Sets the parameter values for this execution of the statement.

Has no effect if the activation has been closed.

NOTE: The setParameters() method is currently unimplemented. A statement with parameters will generate its own ParameterValueSet, which can be gotten with the getParameterValueSet() method (above). The idea behind setParameters() is to improve performance when operating across a network by allowing all the parameters to be set in one call, as opposed to one call per parameter.
Parameters:
  parameterValues - The values of the parameters.




setParentResultSet
public void setParentResultSet(TemporaryRowHolder rs, String resultSetId)(Code)



setResultSetHoldability
public void setResultSetHoldability(boolean resultSetHoldability)(Code)
Set current resultset holdability.
Parameters:
  resultSetHoldability - The new resultset holdability.



setSingleExecution
void setSingleExecution()(Code)
Set this Activation for a single execution. E.g. a java.sql.Statement execution.



setTargetVTI
public void setTargetVTI(java.sql.ResultSet targetVTI)(Code)
Save the ResultSet for the target of an update/delete to a VTI.



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