Java Doc for Statement.java in  » Database-DBMS » mckoi » com » mckoi » database » interpret » 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 » mckoi » com.mckoi.database.interpret 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.mckoi.database.interpret.Statement

All known Subclasses:   com.mckoi.database.interpret.UpdateTable,  com.mckoi.database.interpret.Function,  com.mckoi.database.interpret.Insert,  com.mckoi.database.interpret.DropTable,  com.mckoi.database.interpret.Compact,  com.mckoi.database.interpret.CreateTable,  com.mckoi.database.interpret.Sequence,  com.mckoi.database.interpret.DropTrigger,  com.mckoi.database.interpret.Delete,  com.mckoi.database.interpret.ViewManager,  com.mckoi.database.interpret.Misc,  com.mckoi.database.interpret.Set,  com.mckoi.database.interpret.NoOp,  com.mckoi.database.interpret.CreateTrigger,  com.mckoi.database.interpret.Call,  com.mckoi.database.interpret.CompleteTransaction,  com.mckoi.database.interpret.PrivManager,  com.mckoi.database.interpret.Show,  com.mckoi.database.interpret.Select,  com.mckoi.database.interpret.UserManager,  com.mckoi.database.interpret.Schema,  com.mckoi.database.interpret.AlterTable,
Statement
abstract public class Statement (Code)
Provides a set of useful utility functions to use by all the interpretted statements.
author:
   Tobias Downer


Field Summary
protected  StatementTreecmd
     The StatementTree object that is the container for the query.
protected  DatabaseConnectiondatabase
     The Database context.
protected  SQLQueryquery
     The SQLQuery object that was used to produce this statement.
protected  Vectortable_list
     The list of all FromTableInterface objects of resources referenced in this query.
protected  Useruser
     The user context.


Method Summary
final public  DebugLoggerDebug()
     Returns a DebugLogger object used to log debug commands.
protected  voidaddTable(FromTableInterface table)
     Add an FromTableInterface that is used within this query.
abstract public  Tableevaluate()
     Evaluates the statement and returns a table that represents the result set.
 booleanexistsTableWithColumn(Variable column_name)
     Given a fully resolved table name ( eg.
 FromTableInterfacefindTableInQuery(String schema, String name)
     Returns the first FromTableInterface object that matches the given schema, table reference.
 FromTableInterfacefindTableWithColumn(Variable column_name)
     Given a fully resolved table name ( eg.
final public  voidinit(DatabaseConnection db, StatementTree stree, SQLQuery query)
     Sets up internal variables for this statement for derived classes to use.
abstract public  voidprepare()
     Prepares the statement with the given Database object.
 voidreset()
     Resets this statement so it may be re-prepared and evaluated again.
 ArrayListresolveAgainstAliases(Variable alias_name)
     Overwrite this method if your statement has some sort of column aliasing capability (such as a select statement).
 VariableresolveColumn(Variable v)
     Attempts to resolve an ambiguous column name such as 'id' into a Variable from the tables in this statement.
 voidresolveExpression(Expression exp)
     Given an Expression, this will run through the expression and resolve any variable names via the 'resolveVariableName' method here.
 TableNameresolveTableName(String name, DatabaseConnection db)
     Resolves a TableName string (eg.
final public  voidresolveTree()
     Performs initial preparation on the contents of the StatementTree by resolving all sub queries and mapping functions to their executable forms.

Given a StatementTree and a Database context, this method will convert all sub-queries found in the StatementTree to a Queriable object.

public  VariableresolveVariableName(Variable v)
     Given a Variable object, this will resolve the name into a column name the database understands (substitutes aliases, etc).

Field Detail
cmd
protected StatementTree cmd(Code)
The StatementTree object that is the container for the query.



database
protected DatabaseConnection database(Code)
The Database context.



query
protected SQLQuery query(Code)
The SQLQuery object that was used to produce this statement.



table_list
protected Vector table_list(Code)
The list of all FromTableInterface objects of resources referenced in this query. (FromTableInterface)



user
protected User user(Code)
The user context.





Method Detail
Debug
final public DebugLogger Debug()(Code)
Returns a DebugLogger object used to log debug commands.



addTable
protected void addTable(FromTableInterface table)(Code)
Add an FromTableInterface that is used within this query. These tables are used when we try to resolve a column name.



evaluate
abstract public Table evaluate() throws DatabaseException, TransactionException(Code)
Evaluates the statement and returns a table that represents the result set. This is called after 'prepare'.



existsTableWithColumn
boolean existsTableWithColumn(Variable column_name)(Code)
Given a fully resolved table name ( eg. Part.id ) this returns true if there is a table with the given column name, otherwise false.

NOTE: Intended to be overwritten...




findTableInQuery
FromTableInterface findTableInQuery(String schema, String name)(Code)
Returns the first FromTableInterface object that matches the given schema, table reference. Returns null if no objects with the given schema/name reference match.



findTableWithColumn
FromTableInterface findTableWithColumn(Variable column_name)(Code)
Given a fully resolved table name ( eg. Part.id ) this method will attempt to find the Table object that the column is in.



init
final public void init(DatabaseConnection db, StatementTree stree, SQLQuery query)(Code)
Sets up internal variables for this statement for derived classes to use. This is called before 'prepare' and 'isExclusive' is called.

It is assumed that any ? style parameters in the StatementTree will have been resolved previous to a call to this method.
Parameters:
  db - the DatabaseConnection that will execute this statement.
Parameters:
  stree - the StatementTree that contains the parsed content of thestatement being executed.




prepare
abstract public void prepare() throws DatabaseException(Code)
Prepares the statement with the given Database object. This is called before the statement is evaluated. The prepare statement queries the database and resolves information about the statement (for example, it resolves column names and aliases and determines the tables that are touched by this statement so we can lock the appropriate tables before we evaluate).

NOTE: Care must be taken to ensure that all methods called here are safe in as far as modifications to the data occuring. The rules for safety should be as follows. If the database is in EXCLUSIVE mode, then we need to wait until it's switched back to SHARED mode before this method is called. All collection of information done here should not involve any table state info. except for column count, column names, column types, etc. Queries such as obtaining the row count, selectable scheme information, and certainly 'getCellContents' must never be called during prepare. When prepare finishes, the affected tables are locked and the query is safe to 'evaluate' at which time table state is safe to inspect.




reset
void reset()(Code)
Resets this statement so it may be re-prepared and evaluated again. Useful for repeating a query multiple times.



resolveAgainstAliases
ArrayList resolveAgainstAliases(Variable alias_name)(Code)
Overwrite this method if your statement has some sort of column aliasing capability (such as a select statement). Returns a list of all fully qualified Variables that match the alias name, or an empty list if no matches found.

By default, returns an empty list.




resolveColumn
Variable resolveColumn(Variable v)(Code)
Attempts to resolve an ambiguous column name such as 'id' into a Variable from the tables in this statement.



resolveExpression
void resolveExpression(Expression exp)(Code)
Given an Expression, this will run through the expression and resolve any variable names via the 'resolveVariableName' method here.



resolveTableName
TableName resolveTableName(String name, DatabaseConnection db)(Code)
Resolves a TableName string (eg. 'Customer' 'APP.Customer' ) to a TableName object. If the schema part of the table name is not present then it is set to the current schema of the database connection. If the database is ignoring the case then this will correctly resolve the table to the cased version of the table name.



resolveTree
final public void resolveTree() throws DatabaseException(Code)
Performs initial preparation on the contents of the StatementTree by resolving all sub queries and mapping functions to their executable forms.

Given a StatementTree and a Database context, this method will convert all sub-queries found in the StatementTree to a Queriable object. In other words, all StatementTree are converted to Select objects. The given 'database' object is used as the session to prepare the sub-queries against.

This is called after 'init' and before 'prepare'.




resolveVariableName
public Variable resolveVariableName(Variable v)(Code)
Given a Variable object, this will resolve the name into a column name the database understands (substitutes aliases, etc).



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.