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


java.lang.Object
   org.apache.derby.impl.sql.GenericPreparedStatement

All known Subclasses:   org.apache.derby.impl.sql.GenericStorablePreparedStatement,
GenericPreparedStatement
public class GenericPreparedStatement implements ExecPreparedStatement(Code)
Basic implementation of prepared statement. relies on implementation of ResultDescription and Statement that are also in this package.

These are both dependents (of the schema objects and prepared statements they depend on) and providers. Prepared statements that are providers are cursors that end up being used in positioned delete and update statements (at present).

This is impl with the regular prepared statements; they will never have the cursor info fields set.

Stored prepared statements extend this implementation
author:
   ames



Field Summary
protected  StringUUIDString
    
protected  UUIDUUIDValue
    
protected  GeneratedClassactivationClass
    
protected  TimestampbeginCompileTimestamp
    
protected  longbindTime
    
protected  longcompileTime
    
 booleancompilingStatement
    
protected  TimestampendCompileTimestamp
    
protected  ConstantActionexecutionConstants
    
protected  longgenerateTime
    
protected  booleanisAtomic
    
protected  booleanisValid
    
protected  longoptimizeTime
    
protected  DataTypeDescriptor[]paramTypeDescriptors
    
protected  longparseTime
    
protected  ListrequiredPermissionsList
    
protected  ResultDescriptionresultDesc
    
protected  Object[]savedObjects
    
protected  StringsourceTxt
    
protected  booleanspsAction
    
public  Statementstatement
    
protected  ResultColumnDescriptor[]targetColumns
    
protected  ExecCursorTableReferencetargetTable
    
protected  String[]updateColumns
    
protected  intupdateMode
    

Constructor Summary
 GenericPreparedStatement()
    
public  GenericPreparedStatement(Statement st)
    

Method Summary
 voidcompleteCompile(QueryTreeNode qt)
     Makes the prepared statement valid, assigning values for its query tree, generated class, and associated information.
public  ResultSetexecute(LanguageConnectionContext lcc, boolean rollbackParentContext, long timeoutMillis)
    
public  ResultSetexecute(Activation activation, boolean rollbackParentContext, long timeoutMillis)
     The guts of execution.
public  voidfinish(LanguageConnectionContext lcc)
     Finish marks a statement as totally unusable.
public synchronized  ActivationgetActivation(LanguageConnectionContext lcc, boolean scrollable)
     Get a new activation instance.
public  GeneratedClassgetActivationClass()
    
public  TimestampgetBeginCompileTimestamp()
    
public  longgetBindTimeInMillis()
     Get the bind time for the associated query in milliseconds.
 ByteArraygetByteCodeSaver()
     Get the byte code saver for this statement. Overridden for StorablePreparedStatement.
public  StringgetClassType()
     Get the Dependable's class type.
public  ExecPreparedStatementgetClone()
     Get a new prepared statement that is a shallow copy of the current one.
public  longgetCompileTimeInMillis()
     Get the total compile time for the associated query in milliseconds.
final public  SQLWarninggetCompileTimeWarnings()
    
final public  ConstantActiongetConstantAction()
     Get the Execution constants.
public  ObjectgetCursorInfo()
     Return the cursor info in a single chunk.
public  DependableFindergetDependableFinder()
    
public  TimestampgetEndCompileTimestamp()
    
public  longgetGenerateTimeInMillis()
     Get the generate time for the associated query in milliseconds.
public  UUIDgetObjectID()
     Get the Dependable's UUID String.
public  StringgetObjectName()
     Return the name of this Dependable.
public  longgetOptimizeTimeInMillis()
     Get the optimize time for the associated query in milliseconds.
public  DataTypeDescriptor[]getParameterTypes()
    
public  longgetParseTimeInMillis()
     Get the parse time for the associated query in milliseconds.
public  ListgetRequiredPermissionsList()
    
public  ResultDescriptiongetResultDescription()
    
public  StringgetSPSName()
    
final public  ObjectgetSavedObject(int objectNum)
     Get the specified saved object.
final public  Object[]getSavedObjects()
     Get the saved objects.
public  StringgetSource()
    
public  ResultColumnDescriptor[]getTargetColumns()
    
public  ExecCursorTableReferencegetTargetTable()
    
public  String[]getUpdateColumns()
    
public  intgetUpdateMode()
    
public  booleanisAtomic()
     Returns whether or not this Statement requires should behave atomically -- i.e.
public  booleanisPersistent()
     Is this dependent persistent? A stored dependency will be required if both the dependent and provider are persistent.
public  booleanisStorable()
    
public  booleanisValid()
     Check that all of the dependent's dependencies are valid.
public  voidmakeInvalid(int action, LanguageConnectionContext lcc)
     Mark the dependent as invalid (due to at least one of its dependencies being invalid).
public  voidmakeValid(LanguageConnectionContext lcc)
     Attempt to revalidate the dependent.
public  booleanneedsSavepoint()
    
public  voidprepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc)
     Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid).
public  voidrePrepare(LanguageConnectionContext lcc)
    
public  booleanreferencesSessionSchema()
     Return true if the query node for this statement references SESSION schema tables/views. This method gets called at the very beginning of the compile phase of any statement. If the statement which needs to be compiled is already found in cache, then there is no need to compile it again except the case when the statement is referencing SESSION schema objects.
public  booleanreferencesSessionSchema(QueryTreeNode qt)
     Return true if the QueryTreeNode references SESSION schema tables/views. The return value is also saved in the local field because it will be used by referencesSessionSchema() method.
 voidsetActivationClass(GeneratedClass ac)
    
public  voidsetCacheHolder(Cacheable cacheHolder)
    
protected  voidsetCompileTimeMillis(long parseTime, long bindTime, long optimizeTime, long generateTime, long compileTime, Timestamp beginCompileTimestamp, Timestamp endCompileTimestamp)
     Set the compile time for this prepared statement.
 voidsetCompileTimeWarnings(SQLWarning warnings)
    
final  voidsetConstantAction(ConstantAction constantAction)
     Set the Execution constants.
 voidsetCursorInfo(CursorInfo cursorInfo)
    
 voidsetExecuteStatementNameAndSchema(String execStmtName, String execSchemaName)
     Set the name of the statement and schema for an "execute statement" command.
 voidsetIsAtomic(boolean isAtomic)
     Set the stmts 'isAtomic' state.
 voidsetNeedsSavepoint(boolean needsSavepoint)
     Set the stmts 'needsSavepoint' state.
public  voidsetRequiredPermissionsList(List requiredPermissionsList)
    
public  voidsetSPSAction()
     Indicate this prepared statement is an SPS action, currently used by GenericTriggerExecutor.
final public  voidsetSPSName(String name)
    
final  voidsetSavedObjects(Object[] objects)
     Set the saved objects.
public  voidsetSource(String text)
    
public  voidsetValid()
     set this prepared statement to be valid, currently used by GenericTriggerExecutor.
public  StringtoString()
    
public synchronized  booleanupToDate()
    

Field Detail
UUIDString
protected String UUIDString(Code)



UUIDValue
protected UUID UUIDValue(Code)



activationClass
protected GeneratedClass activationClass(Code)



beginCompileTimestamp
protected Timestamp beginCompileTimestamp(Code)



bindTime
protected long bindTime(Code)



compileTime
protected long compileTime(Code)



compilingStatement
boolean compilingStatement(Code)



endCompileTimestamp
protected Timestamp endCompileTimestamp(Code)



executionConstants
protected ConstantAction executionConstants(Code)



generateTime
protected long generateTime(Code)



isAtomic
protected boolean isAtomic(Code)



isValid
protected boolean isValid(Code)



optimizeTime
protected long optimizeTime(Code)



paramTypeDescriptors
protected DataTypeDescriptor[] paramTypeDescriptors(Code)



parseTime
protected long parseTime(Code)



requiredPermissionsList
protected List requiredPermissionsList(Code)



resultDesc
protected ResultDescription resultDesc(Code)



savedObjects
protected Object[] savedObjects(Code)



sourceTxt
protected String sourceTxt(Code)



spsAction
protected boolean spsAction(Code)



statement
public Statement statement(Code)



targetColumns
protected ResultColumnDescriptor[] targetColumns(Code)



targetTable
protected ExecCursorTableReference targetTable(Code)



updateColumns
protected String[] updateColumns(Code)



updateMode
protected int updateMode(Code)




Constructor Detail
GenericPreparedStatement
GenericPreparedStatement()(Code)



GenericPreparedStatement
public GenericPreparedStatement(Statement st)(Code)




Method Detail
completeCompile
void completeCompile(QueryTreeNode qt) throws StandardException(Code)
Makes the prepared statement valid, assigning values for its query tree, generated class, and associated information.
Parameters:
  qt - the query tree for this statement
exception:
  StandardException - thrown on failure.



execute
public ResultSet execute(LanguageConnectionContext lcc, boolean rollbackParentContext, long timeoutMillis) throws StandardException(Code)



execute
public ResultSet execute(Activation activation, boolean rollbackParentContext, long timeoutMillis) throws StandardException(Code)
The guts of execution.
Parameters:
  activation - the activation to run.
Parameters:
  rollbackParentContext - True if 1) the statement context isNOT a top-level context, AND 2) in the event of a statement-levelexception, the parent context needs to be rolled back, too.
Parameters:
  timeoutMillis - timeout value in milliseconds. the result set to be pawed through
exception:
  StandardException - thrown on error



finish
public void finish(LanguageConnectionContext lcc)(Code)
Finish marks a statement as totally unusable.



getActivation
public synchronized Activation getActivation(LanguageConnectionContext lcc, boolean scrollable) throws StandardException(Code)
Get a new activation instance.
exception:
  StandardException - thrown if finished.



getActivationClass
public GeneratedClass getActivationClass() throws StandardException(Code)



getBeginCompileTimestamp
public Timestamp getBeginCompileTimestamp()(Code)
Get the timestamp for the beginning of compilation Timestamp The timestamp for the beginning of compilation.



getBindTimeInMillis
public long getBindTimeInMillis()(Code)
Get the bind time for the associated query in milliseconds. long The bind time for the associated query in milliseconds.



getByteCodeSaver
ByteArray getByteCodeSaver()(Code)
Get the byte code saver for this statement. Overridden for StorablePreparedStatement. We don't want to save anything a byte code saver (null for us)



getClassType
public String getClassType()(Code)
Get the Dependable's class type. String Classname that this Dependable belongs to.



getClone
public ExecPreparedStatement getClone() throws StandardException(Code)
Get a new prepared statement that is a shallow copy of the current one. a new prepared statement
exception:
  StandardException - on error



getCompileTimeInMillis
public long getCompileTimeInMillis()(Code)
Get the total compile time for the associated query in milliseconds. Compile time can be divided into parse, bind, optimize and generate times. long The total compile time for the associated query in milliseconds.



getCompileTimeWarnings
final public SQLWarning getCompileTimeWarnings()(Code)



getConstantAction
final public ConstantAction getConstantAction()(Code)
Get the Execution constants. This routine is called at Execution time. ConstantAction The big structure enclosing the Execution constants.



getCursorInfo
public Object getCursorInfo()(Code)
Return the cursor info in a single chunk. Used by StrorablePreparedStatement



getDependableFinder
public DependableFinder getDependableFinder()(Code)
the stored form of this Dependable
See Also:   Dependable.getDependableFinder



getEndCompileTimestamp
public Timestamp getEndCompileTimestamp()(Code)
Get the timestamp for the end of compilation Timestamp The timestamp for the end of compilation.



getGenerateTimeInMillis
public long getGenerateTimeInMillis()(Code)
Get the generate time for the associated query in milliseconds. long The generate time for the associated query in milliseconds.



getObjectID
public UUID getObjectID()(Code)
Get the Dependable's UUID String. String The Dependable's UUID String.



getObjectName
public String getObjectName()(Code)
Return the name of this Dependable. (Useful for errors.) String The name of this Dependable..



getOptimizeTimeInMillis
public long getOptimizeTimeInMillis()(Code)
Get the optimize time for the associated query in milliseconds. long The optimize time for the associated query in milliseconds.



getParameterTypes
public DataTypeDescriptor[] getParameterTypes()(Code)



getParseTimeInMillis
public long getParseTimeInMillis()(Code)
Get the parse time for the associated query in milliseconds. long The parse time for the associated query in milliseconds.



getRequiredPermissionsList
public List getRequiredPermissionsList()(Code)



getResultDescription
public ResultDescription getResultDescription()(Code)



getSPSName
public String getSPSName()(Code)



getSavedObject
final public Object getSavedObject(int objectNum)(Code)
Get the specified saved object.
Parameters:
  objectNum - The object to get. the requested saved object.



getSavedObjects
final public Object[] getSavedObjects()(Code)
Get the saved objects. all the saved objects



getSource
public String getSource()(Code)



getTargetColumns
public ResultColumnDescriptor[] getTargetColumns()(Code)
the target columns of the cursor as a result column list target columns of the cursor as a result column list



getTargetTable
public ExecCursorTableReference getTargetTable()(Code)
the target table of the cursor target table of the cursor



getUpdateColumns
public String[] getUpdateColumns()(Code)
the update columns of the cursor as a update column list update columns of the cursor as a array of strings



getUpdateMode
public int getUpdateMode()(Code)
the update mode of the cursor The update mode of the cursor



isAtomic
public boolean isAtomic()(Code)
Returns whether or not this Statement requires should behave atomically -- i.e. whether a user is permitted to do a commit/rollback during the execution of this statement. boolean Whether or not this Statement is atomic



isPersistent
public boolean isPersistent()(Code)
Is this dependent persistent? A stored dependency will be required if both the dependent and provider are persistent. boolean Whether or not this dependent is persistent.



isStorable
public boolean isStorable()(Code)



isValid
public boolean isValid()(Code)
Check that all of the dependent's dependencies are valid. true if the dependent is currently valid



makeInvalid
public void makeInvalid(int action, LanguageConnectionContext lcc) throws StandardException(Code)
Mark the dependent as invalid (due to at least one of its dependencies being invalid).
Parameters:
  action - The action causing the invalidation
exception:
  StandardException - Standard Cloudscape error policy.



makeValid
public void makeValid(LanguageConnectionContext lcc) throws StandardException(Code)
Attempt to revalidate the dependent. For prepared statements, this could go through its dependencies and check that they are up to date; if not, it would recompile the statement. Any failure during this attempt should throw StandardException.unableToRevalidate().
exception:
  StandardException - thrown if unable to make it valid



needsSavepoint
public boolean needsSavepoint()(Code)
Does this statement need a savepoint? true if this statement needs a savepoint.



prepareToInvalidate
public void prepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc) throws StandardException(Code)
Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid).
Parameters:
  action - The action causing the invalidation
Parameters:
  p - the provider
exception:
  StandardException - thrown if unable to make it invalid



rePrepare
public void rePrepare(LanguageConnectionContext lcc) throws StandardException(Code)



referencesSessionSchema
public boolean referencesSessionSchema()(Code)
Return true if the query node for this statement references SESSION schema tables/views. This method gets called at the very beginning of the compile phase of any statement. If the statement which needs to be compiled is already found in cache, then there is no need to compile it again except the case when the statement is referencing SESSION schema objects. There is a small window where such a statement might get cached temporarily (a statement referencing SESSION schema object will be removed from the cache after the bind phase is over because that is when we know for sure that the statement is referencing SESSION schema objects.) true if references SESSION schema tables, else false



referencesSessionSchema
public boolean referencesSessionSchema(QueryTreeNode qt) throws StandardException(Code)
Return true if the QueryTreeNode references SESSION schema tables/views. The return value is also saved in the local field because it will be used by referencesSessionSchema() method. This method gets called when the statement is not found in cache and hence it is getting compiled. At the beginning of compilation for any statement, first we check if the statement's plan already exist in the cache. If not, then we add the statement to the cache and continue with the parsing and binding. At the end of the binding, this method gets called to see if the QueryTreeNode references a SESSION schema object. If it does, then we want to remove it from the cache, since any statements referencing SESSION schema objects should never get cached. true if references SESSION schema tables/views, else false



setActivationClass
void setActivationClass(GeneratedClass ac)(Code)



setCacheHolder
public void setCacheHolder(Cacheable cacheHolder)(Code)



setCompileTimeMillis
protected void setCompileTimeMillis(long parseTime, long bindTime, long optimizeTime, long generateTime, long compileTime, Timestamp beginCompileTimestamp, Timestamp endCompileTimestamp)(Code)
Set the compile time for this prepared statement.
Parameters:
  compileTime - The compile time



setCompileTimeWarnings
void setCompileTimeWarnings(SQLWarning warnings)(Code)



setConstantAction
final void setConstantAction(ConstantAction constantAction)(Code)
Set the Execution constants. This routine is called as we Prepare the statement.
Parameters:
  constantAction - The big structure enclosing the Execution constants.



setCursorInfo
void setCursorInfo(CursorInfo cursorInfo)(Code)



setExecuteStatementNameAndSchema
void setExecuteStatementNameAndSchema(String execStmtName, String execSchemaName)(Code)
Set the name of the statement and schema for an "execute statement" command.



setIsAtomic
void setIsAtomic(boolean isAtomic)(Code)
Set the stmts 'isAtomic' state.
Parameters:
  isAtomic - true if this statement must be atomic(i.e. it is not ok to do a commit/rollback in the middle)



setNeedsSavepoint
void setNeedsSavepoint(boolean needsSavepoint)(Code)
Set the stmts 'needsSavepoint' state. Used by an SPS to convey whether the underlying stmt needs a savepoint or not.
Parameters:
  needsSavepoint - true if this statement needs a savepoint.



setRequiredPermissionsList
public void setRequiredPermissionsList(List requiredPermissionsList)(Code)



setSPSAction
public void setSPSAction()(Code)
Indicate this prepared statement is an SPS action, currently used by GenericTriggerExecutor.



setSPSName
final public void setSPSName(String name)(Code)



setSavedObjects
final void setSavedObjects(Object[] objects)(Code)
Set the saved objects. Called when compilation completes.
Parameters:
  objects - The objects to save from compilation



setSource
public void setSource(String text)(Code)



setValid
public void setValid()(Code)
set this prepared statement to be valid, currently used by GenericTriggerExecutor.



toString
public String toString()(Code)



upToDate
public synchronized boolean upToDate() throws StandardException(Code)



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.