|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.impl.tools.planexporter.AccessDatabase
public class AccessDatabase
This class will perform the database connection establishment, querying the database, shut downing the database. Created under DERBY-4587-PlanExporter tool
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
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)
|
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
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
dburl - aSchema - aQuery -
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.sql.SQLException
public AccessDatabase(java.sql.Connection aConn,
java.lang.String aSchema,
java.lang.String aQuery)
throws java.sql.SQLException
aConn - aSchema - aQuery -
java.sql.SQLException| Method Detail |
|---|
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.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.sql.SQLException
private void setSchema()
throws java.sql.SQLException
java.sql.SQLException - if an error happens while accessing the database
private boolean schemaExists()
throws java.sql.SQLException
java.sql.SQLExceptionpublic 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.SQLExceptionpublic 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 needed
public void markTheDepth()
private void findChildren(int idx,
int dep)
idx - current element's indexdep - current examining depth
public 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 executed
java.sql.SQLException
private int noOfNodes()
throws java.sql.SQLException
java.sql.SQLException
public java.lang.String statement()
throws java.sql.SQLException
java.sql.SQLExceptionprivate static java.lang.String escapeForXML(java.lang.String text)
text - the text to escape
private java.lang.String escapeInAttribute(java.lang.String text)
text - attribute string to be checked
public java.lang.String time()
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.lang.String stmtID()
public void closeConnection()
public TreeNode[] getData()
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||