public class AccessDatabase
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.sql.Connection |
conn |
private TreeNode[] |
data |
private int |
depth |
private static int |
ID |
private static int |
INPUT_ROWS |
private static int |
NEXT_QUALIFIERS |
private static int |
NO_OF_OPENS |
private static int |
NO_OF_OUTPUT_ROWS_BY_SORTER |
private static int |
NODE_TYPE |
private static int |
P_ID |
private java.lang.String |
query |
private static int |
RETURNED_ROWS |
private static int |
SCAN_QUALIFIERS |
private static int |
SCAN_TYPE |
private static int |
SCANNED_OBJECT |
private java.lang.String |
schema |
private boolean |
schemaExists |
private static int |
SORT_TYPE |
private static int |
VISITED_PAGES |
private java.lang.String |
xmlDetails |
Constructor and Description |
---|
AccessDatabase(java.sql.Connection aConn,
java.lang.String aSchema,
java.lang.String aQuery) |
AccessDatabase(java.lang.String dburl,
java.lang.String aSchema,
java.lang.String aQuery) |
Modifier and Type | Method and Description |
---|---|
void |
closeConnection()
closing the connection to the database
|
private static java.sql.Connection |
createConnection(java.lang.String dbURL) |
private void |
createXMLData(java.lang.String qry,
int x)
Create XML data based on the query that's passed in.
|
void |
createXMLFragment()
This method creates the queries such that after execution
of the query it will return XML data fragments.
|
private static java.lang.String |
escapeForXML(java.lang.String text)
Escape characters that have a special meaning in XML.
|
private java.lang.String |
escapeInAttribute(java.lang.String text)
This method is needed since in the case of XML attributes
we have to filter the quotation (") marks that is compulsory.
|
private void |
findChildren(int idx,
int dep) |
private void |
getChildren(int currentLevel,
java.lang.String id) |
TreeNode[] |
getData() |
int |
getDepth() |
java.lang.String |
getQuery() |
java.lang.String |
getXmlString()
Generating the XML tree
|
java.lang.String |
indent(int j) |
boolean |
initializeDataArray() |
void |
markTheDepth()
marking the depth of each element
|
private int |
noOfNodes() |
private boolean |
schemaExists()
Check if there is a schema in the database that matches the schema
name that was passed in to this instance.
|
private void |
setSchema()
Set the schema of the current connection to the XPLAIN schema in
which the statistics can be found.
|
java.lang.String |
statement() |
java.lang.String |
stmtID() |
java.lang.String |
time() |
boolean |
verifySchemaExistance() |
private final java.sql.Connection conn
private final java.lang.String schema
private final java.lang.String query
private final boolean schemaExists
private TreeNode[] data
private int depth
private java.lang.String xmlDetails
private static final int ID
private static final int P_ID
private static final int NODE_TYPE
private static final int NO_OF_OPENS
private static final int INPUT_ROWS
private static final int RETURNED_ROWS
private static final int VISITED_PAGES
private static final int SCAN_QUALIFIERS
private static final int NEXT_QUALIFIERS
private static final int SCANNED_OBJECT
private static final int SCAN_TYPE
private static final int SORT_TYPE
private static final int NO_OF_OUTPUT_ROWS_BY_SORTER
public AccessDatabase(java.lang.String dburl, java.lang.String aSchema, java.lang.String aQuery) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException, java.sql.SQLException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
dburl
- aSchema
- aQuery
- java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.sql.SQLException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
public AccessDatabase(java.sql.Connection aConn, java.lang.String aSchema, java.lang.String aQuery) throws java.sql.SQLException
aConn
- aSchema
- aQuery
- java.sql.SQLException
public java.lang.String getQuery()
public int getDepth()
private static java.sql.Connection createConnection(java.lang.String dbURL) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException, java.sql.SQLException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.sql.SQLException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
private void setSchema() throws java.sql.SQLException
java.sql.SQLException
- if an error happens while accessing the databaseprivate boolean schemaExists() throws java.sql.SQLException
java.sql.SQLException
public boolean verifySchemaExistance()
public void createXMLFragment() throws java.sql.SQLException
This method creates the queries such that after execution of the query it will return XML data fragments.
java.sql.SQLException
public java.lang.String getXmlString()
private void getChildren(int currentLevel, java.lang.String id)
currentLevel
- level of the XML tree (0 based) of current nodeid
- current node's stmt_idpublic java.lang.String indent(int j)
j
- indent neededpublic void markTheDepth()
private void findChildren(int idx, int dep)
idx
- current element's indexdep
- current examining depthpublic boolean initializeDataArray() throws java.sql.SQLException
java.sql.SQLException
private void createXMLData(java.lang.String qry, int x) throws java.sql.SQLException
qry
- query to be executedjava.sql.SQLException
private int noOfNodes() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String statement() throws java.sql.SQLException
java.sql.SQLException
private static java.lang.String escapeForXML(java.lang.String text)
text
- the text to escapeprivate java.lang.String escapeInAttribute(java.lang.String text)
text
- attribute string to be checkedpublic java.lang.String time() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String stmtID()
public void closeConnection()
public TreeNode[] getData()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.