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


java.lang.Object
   org.apache.derby.iapi.sql.dictionary.TupleDescriptor
      org.apache.derby.iapi.sql.dictionary.SPSDescriptor

SPSDescriptor
public class SPSDescriptor extends TupleDescriptor implements UniqueSQLObjectDescriptor,Dependent,Provider(Code)
A SPSDescriptor describes a Stored Prepared Statement. It correlates to a row in SYS.SYSSTATEMENTS. SYNCHRONIZATION: Stored prepared statements may be cached. Thus they may be shared by multiple threads. It is very hard for two threads to try to muck with an sps simultaeously because all ddl (including sps recompilation) clears out the sps cache and invalidates whatever statement held a cached sps. But it is possible for two statements to do a prepare execute statment at the exact same time, so both try to do an sps.prepare() at the same time during code generation, so we synchronize most everything except getters on immutable objects just to be on the safe side.
author:
   jamie


Field Summary
final public static  charSPS_TYPE_EXPLAIN
    
final public static  charSPS_TYPE_REGULAR
    
final public static  charSPS_TYPE_TRIGGER
     Statement types.

Constructor Summary
public  SPSDescriptor(DataDictionary dataDictionary, String name, UUID uuid, UUID suuid, UUID compSchemaUUID, char type, boolean valid, String text, boolean initiallyCompilable)
    
public  SPSDescriptor(DataDictionary dataDictionary, String name, UUID uuid, UUID suuid, UUID compSchemaUUID, char type, boolean valid, String text, String usingText, Timestamp compileTime, ExecPreparedStatement preparedStatement, boolean initiallyCompilable)
     Constructor for a SPS Descriptor.

Method Summary
final public  StringgetClassType()
     Get the provider's type.
final public  UUIDgetCompSchemaId()
     Get the compilation type schema id when this view was first bound.
final public synchronized  TimestampgetCompileTime()
    
final public  DependableFindergetDependableFinder()
    
public  StringgetDescriptorName()
    
public  StringgetDescriptorType()
    
final public  StringgetName()
     Gets the name of the sps.
final public  UUIDgetObjectID()
    
final public  StringgetObjectName()
     Return the name of this Provider.
final public synchronized  Object[]getParameterDefaults()
     Get the default parameter values for this statement.
final public synchronized  DataTypeDescriptor[]getParams()
     Get the array of date type descriptors for this statement.
final public  ExecPreparedStatementgetPreparedStatement()
     Get the preparedStatement for this statement.
final public synchronized  ExecPreparedStatementgetPreparedStatement(boolean recompIfInvalid)
     Get the preparedStatement for this statement.
final public  StringgetQualifiedName()
     Gets the full, qualified name of the statement.
final public  SchemaDescriptorgetSchemaDescriptor()
     Gets the SchemaDescriptor for this SPS Descriptor.
final public  StringgetText()
     Get the text used to create this statement.
final public  chargetType()
     Gets an identifier telling what type of table this is. Types match final ints in this interface.
final public  StringgetTypeAsString()
     Simple little helper function to convert your type to a string, which is easier to use.
final public  UUIDgetUUID()
     Gets the UUID of the SPS.
final public synchronized  StringgetUsingText()
     Get the text of the USING clause used on CREATE or ALTER statement.
public  booleaninitiallyCompilable()
    
final public synchronized  booleanisValid()
     Check that all of the dependent's dependencies are valid.
public  voidloadGeneratedClass()
     Load the underlying generatd class.
final public synchronized  voidmakeInvalid(int action, LanguageConnectionContext lcc)
     Mark the dependent as invalid (due to at least one of its dependencies being invalid).
final public synchronized  voidmakeValid(LanguageConnectionContext lcc)
     Attempt to revalidate the dependent.
final public synchronized  voidprepareAndRelease(LanguageConnectionContext lcc, TableDescriptor triggerTable, TransactionController tc)
     FOR TRIGGERS ONLY

Generate the class for this SPS and immediately release it.

final public synchronized  voidprepareAndRelease(LanguageConnectionContext lcc, TableDescriptor triggerTable)
     FOR TRIGGERS ONLY

Generate the class for this SPS and immediately release it.

final public synchronized  voidprepareAndRelease(LanguageConnectionContext lcc)
     Generate the class for this SPS and immediately release it.
final public synchronized  voidprepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc)
     Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid).
final public synchronized  voidrevalidate(LanguageConnectionContext lcc)
     Invalidate and revalidate.
final public synchronized  voidsetCompileTime()
    
final public synchronized  voidsetParameterDefaults(Object[] values)
     Set the parameter defaults for this statement.
final public synchronized  voidsetParams(DataTypeDescriptor params)
    
final public synchronized  voidsetUUID(UUID uuid)
     Sets the UUID of the SPS.
final public  StringtoString()
    
final public static  booleanvalidType(char type)
     Validate the type.

Field Detail
SPS_TYPE_EXPLAIN
final public static char SPS_TYPE_EXPLAIN(Code)



SPS_TYPE_REGULAR
final public static char SPS_TYPE_REGULAR(Code)



SPS_TYPE_TRIGGER
final public static char SPS_TYPE_TRIGGER(Code)
Statement types.
  • SPS_TYPE_TRIGGER - trigger (NOT IMPLEMENTED)
  • SPS_TYPE_EXPLAIN - explain (NOT IMPLEMENTED)
  • SPS_TYPE_REGULAR - catchall




Constructor Detail
SPSDescriptor
public SPSDescriptor(DataDictionary dataDictionary, String name, UUID uuid, UUID suuid, UUID compSchemaUUID, char type, boolean valid, String text, boolean initiallyCompilable) throws StandardException(Code)
Constructor for a SPS Descriptor
Parameters:
  dataDictionary - The data dictionary that this descriptor lives in
Parameters:
  name - the SPS name
Parameters:
  uuid - the UUID
Parameters:
  suuid - the schema UUID
Parameters:
  compSchemaUUID - the schema UUID at compilation time
Parameters:
  type - type
Parameters:
  valid - is the sps valid
Parameters:
  text - the text for this statement
Parameters:
  initiallyCompilable - is the statement initially compilable?
exception:
  StandardException - on error



SPSDescriptor
public SPSDescriptor(DataDictionary dataDictionary, String name, UUID uuid, UUID suuid, UUID compSchemaUUID, char type, boolean valid, String text, String usingText, Timestamp compileTime, ExecPreparedStatement preparedStatement, boolean initiallyCompilable) throws StandardException(Code)
Constructor for a SPS Descriptor. Used when constructing an SPS descriptor from a row in SYSSTATEMENTS.
Parameters:
  dataDictionary - The data dictionary that this descriptor lives in
Parameters:
  name - the SPS name
Parameters:
  uuid - the UUID
Parameters:
  suuid - the schema UUID
Parameters:
  compSchemaUUID - the schema UUID at compilation time
Parameters:
  type - type
Parameters:
  valid - is the sps valid
Parameters:
  text - the text for this statement
Parameters:
  usingText - the text for the USING clause supplied toCREATE or ALTER STATEMENT
Parameters:
  compileTime - the time this was compiled
Parameters:
  preparedStatement - the PreparedStatement
Parameters:
  initiallyCompilable - is the statement initially compilable?
exception:
  StandardException - on error




Method Detail
getClassType
final public String getClassType()(Code)
Get the provider's type. String The provider's type.



getCompSchemaId
final public UUID getCompSchemaId()(Code)
Get the compilation type schema id when this view was first bound. the schema UUID



getCompileTime
final public synchronized Timestamp getCompileTime()(Code)
The time this prepared statement was compiled the time this class was last compiled



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



getDescriptorName
public String getDescriptorName()(Code)

See Also:   TupleDescriptor.getDescriptorName
See Also:   



getDescriptorType
public String getDescriptorType()(Code)

See Also:   TupleDescriptor.getDescriptorType
See Also:   



getName
final public String getName()(Code)
Gets the name of the sps. A String containing the name of the statement.



getObjectID
final public UUID getObjectID()(Code)
Get the provider's UUID String The provider's UUID



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



getParameterDefaults
final public synchronized Object[] getParameterDefaults() throws StandardException(Code)
Get the default parameter values for this statement. Default parameter values are supplied by a USING clause on either a CREATE or ALTER STATEMENT statement. the default parameter values
exception:
  StandardException - on error



getParams
final public synchronized DataTypeDescriptor[] getParams() throws StandardException(Code)
Get the array of date type descriptors for this statement. Currently, we do a lookup if we don't already have the parameters saved. When SPSes are cached, the parameters should be set up when the sps is constructed. the array of data type descriptors
exception:
  StandardException - on error



getPreparedStatement
final public ExecPreparedStatement getPreparedStatement() throws StandardException(Code)
Get the preparedStatement for this statement. If stmt is invalid or hasn't been compiled yet, it will be recompiled. the preparedStatement
exception:
  StandardException - on error



getPreparedStatement
final public synchronized ExecPreparedStatement getPreparedStatement(boolean recompIfInvalid) throws StandardException(Code)
Get the preparedStatement for this statement. Expects the prepared statement to have already been added to SYS.SYSSTATEMENTS.

Side Effects: will update SYS.SYSSTATEMENTS with the new plan if it needs to be recompiled.
Parameters:
  recompIfInvalid - if false, never recompile evenif statement is invalid the preparedStatement
exception:
  StandardException - on error




getQualifiedName
final public String getQualifiedName()(Code)
Gets the full, qualified name of the statement. A String containing the name of the statement.



getSchemaDescriptor
final public SchemaDescriptor getSchemaDescriptor()(Code)
Gets the SchemaDescriptor for this SPS Descriptor. SchemaDescriptor The SchemaDescriptor.



getText
final public String getText()(Code)
Get the text used to create this statement. Returns original text in a cleartext string. The text



getType
final public char getType()(Code)
Gets an identifier telling what type of table this is. Types match final ints in this interface. Currently returns SPS_TYPE_REGULAR or SPS_TYPE_TRIGGER. An identifier telling what type of statementwe are.



getTypeAsString
final public String getTypeAsString()(Code)
Simple little helper function to convert your type to a string, which is easier to use. type as a string



getUUID
final public UUID getUUID()(Code)
Gets the UUID of the SPS. the uuid



getUsingText
final public synchronized String getUsingText()(Code)
Get the text of the USING clause used on CREATE or ALTER statement. The text



initiallyCompilable
public boolean initiallyCompilable()(Code)
Is the statement initially compilable? false if statement was created with the NOCOMPILE flagtrue otherwise



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



loadGeneratedClass
public void loadGeneratedClass() throws StandardException(Code)
Load the underlying generatd class. This is not expected to be used outside of the datadictionary package. It is used for optimizing class loading for sps cacheing.
exception:
  StandardException - on error



makeInvalid
final public synchronized 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 - thrown if unable to make it invalid



makeValid
final public synchronized 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



prepareAndRelease
final public synchronized void prepareAndRelease(LanguageConnectionContext lcc, TableDescriptor triggerTable, TransactionController tc) throws StandardException(Code)
FOR TRIGGERS ONLY

Generate the class for this SPS and immediately release it. This is useful for cases where we don't want to immediately execute the statement corresponding to this sps (e.g. CREATE STATEMENT).

SIDE EFFECTS: will update and SYSDEPENDS with the prepared statement dependency info.
Parameters:
  lcc - the language connection context
Parameters:
  triggerTable - the table descriptor to bind against. Hadbetter be null if this isn't a trigger sps.
Parameters:
  tc - the transaction controller
exception:
  StandardException - on error




prepareAndRelease
final public synchronized void prepareAndRelease(LanguageConnectionContext lcc, TableDescriptor triggerTable) throws StandardException(Code)
FOR TRIGGERS ONLY

Generate the class for this SPS and immediately release it. This is useful for cases where we don't want to immediately execute the statement corresponding to this sps (e.g. CREATE STATEMENT).

SIDE EFFECTS: will update and SYSDEPENDS with the prepared statement dependency info.
Parameters:
  lcc - the language connection context
Parameters:
  triggerTable - the table descriptor to bind against. Hadbetter be null if this isn't a trigger sps.
exception:
  StandardException - on error




prepareAndRelease
final public synchronized void prepareAndRelease(LanguageConnectionContext lcc) throws StandardException(Code)
Generate the class for this SPS and immediately release it. This is useful for cases where we don't want to immediately execute the statement corresponding to this sps (e.g. CREATE STATEMENT).

SIDE EFFECTS: will update and SYSDEPENDS with the prepared statement dependency info.
Parameters:
  lcc - the language connection context
exception:
  StandardException - on error




prepareToInvalidate
final public synchronized 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



revalidate
final public synchronized void revalidate(LanguageConnectionContext lcc) throws StandardException(Code)
Invalidate and revalidate. The functional equivalent of calling makeInvalid() and makeValid(), except it is optimized.
exception:
  StandardException - on error



setCompileTime
final public synchronized void setCompileTime()(Code)
Set the compile time to now



setParameterDefaults
final public synchronized void setParameterDefaults(Object[] values)(Code)
Set the parameter defaults for this statement.
Parameters:
  values - the parameter defaults



setParams
final public synchronized void setParams(DataTypeDescriptor params)(Code)
Set the list of parameters for this statement
Parameters:
  params - the parameter list



setUUID
final public synchronized void setUUID(UUID uuid)(Code)
Sets the UUID of the SPS.
Parameters:
  uuid - The UUID of the SPS to be set in the descriptor



toString
final public String toString()(Code)
Prints the contents of the TableDescriptor The contents as a String



validType
final public static boolean validType(char type)(Code)
Validate the type. NOTE: Only SPS_TYPE_REGULAR and SPS_TYPE_TRIGGER are currently valid.
Parameters:
  type - the type true/false



Fields inherited from org.apache.derby.iapi.sql.dictionary.TupleDescriptor
final public static int COLUMN_LIST(Code)(Java Doc)
final public static int CONGLOMERATE_LIST(Code)(Java Doc)
final public static int CONSTRAINT_LIST(Code)(Java Doc)
final public static int TRIGGER_LIST(Code)(Java Doc)

Methods inherited from org.apache.derby.iapi.sql.dictionary.TupleDescriptor
DependableFinder getColumnDependableFinder(int formatId, byte[] columnBitMap)(Code)(Java Doc)
protected DataDictionary getDataDictionary() throws StandardException(Code)(Java Doc)
public DependableFinder getDependableFinder(int formatId)(Code)(Java Doc)
public String getDescriptorName()(Code)(Java Doc)
public String getDescriptorType()(Code)(Java Doc)
public boolean isPersistent()(Code)(Java Doc)
protected void setDataDictionary(DataDictionary dd)(Code)(Java Doc)

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.