Java Reference
In-Depth Information
NodeList children = currentRow.getChildNodes();
for(int i=0;i<children.getLength();i++){
if(children.item(i).getNodeType()==Node.ELEMENT_NODE){
columnNameVector.addElement(((Element)children.item(i)).getTagName());
}
}
}
public int getColumnCount()throws java.sql.SQLException{
return columnNameVector.size();
}
public String getColumnLabel(int column)throws java.sql.SQLException{
return (String)columnNameVector.elementAt(column);
}
public String getColumnName(int column)throws java.sql.SQLException{
return (String)columnNameVector.elementAt(column);
}
public int getColumnType(int column)throws java.sql.SQLException{
return java.sql.Types.VARCHAR;
}
public String getColumnTypeName(int column)throws java.sql.SQLException{
return "VARCHAR";
}
public String getTableName(int column)throws java.sql.SQLException{
return ((Element)rows.item(0)).getTagName();
}
}
Implementing the SQL Engine
The SQL engine handles the parsing of the SQL commands into their various components, as well as
performing more detailed processing such as evaluating the logic of compound WHERE clauses. This
application implements only a tiny subset of the SQL-92 command set, but these are enough to process
common queries as well as to create and update XML documents.
The query subset is limited to handling the types of queries listed in Table 19-1 :
Table 19-1: Supported Query Operators
Function
Operator
Comment
 
Search WWH ::




Custom Search