Project

General

Profile

« Previous | Next » 

Revision 177

Added by Matt Jones about 24 years ago

finsihed basic functionality for structured queries based on the DBQuery and QuerySpecification classes

View differences:

src/xmltables.sql
102 102
 */
103 103
CREATE TABLE xml_index (
104 104
	nodeid		NUMBER(20),	-- the unique node id
105
	path		VARCHAR2(20),	-- precomputed path through tree
105
	path		VARCHAR2(200),	-- precomputed path through tree
106 106
   CONSTRAINT xml_index_pk PRIMARY KEY (nodeid,path),
107 107
   CONSTRAINT xml_nodes_fk FOREIGN KEY (nodeid) REFERENCES xml_nodes
108 108
);
109 109

  
110 110
/* 
111
 * Index of the paths in xml_index 
112
 */
113
CREATE INDEX xml_index_idx1 ON xml_index (path);
114

  
115
/* 
111 116
 * table to store unique Accession # for every document in 2 parts
112 117
 */
113 118
CREATE TABLE xml_acc_numbers (
src/edu/ucsb/nceas/metacat/DBSAXNode.java
101 101
      pstmt.execute();
102 102
      pstmt.close();
103 103
      
104
      // Record the node id that was generated fromthe database
105
      setNodeID(nid);
104
      if (nodetype.equals("DOCUMENT") || nodetype.equals("ELEMENT")) {
106 105

  
107
      // Record the node type that was passed in via the constructor
108
      setNodeType(nodetype);
106
        // Record the node id that was generated from the database
107
        setNodeID(nid);
109 108

  
109
        // Record the node type that was passed to the method
110
        setNodeType(nodetype);
111

  
112
      }
113

  
110 114
    } catch (SQLException e) {
111 115
      System.err.println("Error inserting node: (" + nodetype + ", " +
112 116
                                                     nodename + ", " + 
src/edu/ucsb/nceas/metacat/DBWriter.java
104 104
        conn.commit();
105 105
        conn.setAutoCommit(true);
106 106
      } catch (SAXParseException e) {
107
        conn.rollback();
107 108
        System.err.println(e.getMessage());
108 109
      } catch (SAXException e) {
110
        conn.rollback();
109 111
        System.err.println(e.getMessage());
110 112
      } catch (Exception e) {
113
        conn.rollback();
111 114
        System.err.println(e.toString());
112 115
      }
113 116
  }

Also available in: Unified diff