Project

General

Profile

metacat / docs / edu / ucsb / nceas / metacat / DBReader.html @ 138

1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
2
<!--NewPage-->
3
<HTML>
4
<HEAD>
5
<!-- Generated by javadoc on Wed Jun 07 16:35:57 AKDT 2000 -->
6
<TITLE>
7
MetaCat API: Class  DBReader
8
</TITLE>
9
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
10
</HEAD>
11
<BODY BGCOLOR="white">
12

    
13
<!-- ========== START OF NAVBAR ========== -->
14
<A NAME="navbar_top"><!-- --></A>
15
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
16
<TR>
17
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
18
<A NAME="navbar_top_firstrow"><!-- --></A>
19
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
20
  <TR ALIGN="center" VALIGN="top">
21
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
22
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
23
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DBReader.html"><FONT ID="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
24
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
25
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
26
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
27
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
28
  </TR>
29
</TABLE>
30
</TD>
31
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
32
</EM>
33
</TD>
34
</TR>
35

    
36
<TR>
37
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
38
&nbsp;<A HREF="../../../../edu/ucsb/nceas/metacat/DBEntityResolver.html"><B>PREV CLASS</B></A>&nbsp;
39
&nbsp;<A HREF="../../../../edu/ucsb/nceas/metacat/DBReader.DoctypeInfo.html"><B>NEXT CLASS</B></A></FONT></TD>
40
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
41
  <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
42
&nbsp;<A HREF="DBReader.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
43
</TR>
44
<TR>
45
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
46
  SUMMARY: &nbsp;<A HREF="#inner_class_summary">INNER</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
47
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
48
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
49
</TR>
50
</TABLE>
51
<!-- =========== END OF NAVBAR =========== -->
52

    
53
<HR>
54
<!-- ======== START OF CLASS DATA ======== -->
55
<H2>
56
<FONT SIZE="-1">
57
edu.ucsb.nceas.metacat</FONT>
58
<BR>
59
Class  DBReader</H2>
60
<PRE>
61
java.lang.Object
62
  |
63
  +--<B>edu.ucsb.nceas.metacat.DBReader</B>
64
</PRE>
65
<HR>
66
<DL>
67
<DT>public class <B>DBReader</B><DT>extends java.lang.Object</DL>
68

    
69
<P>
70
A Class that creates an XML text document
71
 from a query to a relational DB containing a DOM representation
72
<P>
73
<HR>
74

    
75
<P>
76
<!-- ======== INNER CLASS SUMMARY ======== -->
77

    
78
<A NAME="inner_class_summary"><!-- --></A>
79
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
80
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
81
<TD COLSPAN=2><FONT SIZE="+2">
82
<B>Inner Class Summary</B></FONT></TD>
83
</TR>
84
<TR BGCOLOR="white" CLASS="TableRowColor">
85
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
86
<CODE>&nbsp;class</CODE></FONT></TD>
87
<TD><CODE><B><A HREF="../../../../edu/ucsb/nceas/metacat/DBReader.DoctypeInfo.html">DBReader.DoctypeInfo</A></B></CODE>
88

    
89
<BR>
90
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A utility class that encapsulates document type information</TD>
91
</TR>
92
</TABLE>
93
&nbsp;
94
<!-- =========== FIELD SUMMARY =========== -->
95

    
96

    
97
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
98

    
99
<A NAME="constructor_summary"><!-- --></A>
100
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
101
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
102
<TD COLSPAN=2><FONT SIZE="+2">
103
<B>Constructor Summary</B></FONT></TD>
104
</TR>
105
<TR BGCOLOR="white" CLASS="TableRowColor">
106
<TD><CODE><B><A HREF="../../../../edu/ucsb/nceas/metacat/DBReader.html#DBReader(java.sql.Connection)">DBReader</A></B>(java.sql.Connection&nbsp;conn)</CODE>
107

    
108
<BR>
109
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;construct a DBReader instance.</TD>
110
</TR>
111
</TABLE>
112
&nbsp;
113
<!-- ========== METHOD SUMMARY =========== -->
114

    
115
<A NAME="method_summary"><!-- --></A>
116
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
117
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
118
<TD COLSPAN=2><FONT SIZE="+2">
119
<B>Method Summary</B></FONT></TD>
120
</TR>
121
<TR BGCOLOR="white" CLASS="TableRowColor">
122
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
123
<CODE>&nbsp;<A HREF="../../../../edu/ucsb/nceas/metacat/DBReader.DoctypeInfo.html">DBReader.DoctypeInfo</A></CODE></FONT></TD>
124
<TD><CODE><B><A HREF="../../../../edu/ucsb/nceas/metacat/DBReader.html#getDoctypeInfo(long)">getDoctypeInfo</A></B>(long&nbsp;docid)</CODE>
125

    
126
<BR>
127
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Look up the document type information from the database</TD>
128
</TR>
129
<TR BGCOLOR="white" CLASS="TableRowColor">
130
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
131
<CODE>&nbsp;long</CODE></FONT></TD>
132
<TD><CODE><B><A HREF="../../../../edu/ucsb/nceas/metacat/DBReader.html#getRootNode(long)">getRootNode</A></B>(long&nbsp;docid)</CODE>
133

    
134
<BR>
135
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the root node id for an XML document given a document id</TD>
136
</TR>
137
<TR BGCOLOR="white" CLASS="TableRowColor">
138
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
139
<CODE>static&nbsp;void</CODE></FONT></TD>
140
<TD><CODE><B><A HREF="../../../../edu/ucsb/nceas/metacat/DBReader.html#main(java.lang.String[])">main</A></B>(java.lang.String[]&nbsp;args)</CODE>
141

    
142
<BR>
143
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;main routine used for testing.</TD>
144
</TR>
145
<TR BGCOLOR="white" CLASS="TableRowColor">
146
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
147
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
148
<TD><CODE><B><A HREF="../../../../edu/ucsb/nceas/metacat/DBReader.html#readXMLDocument(long)">readXMLDocument</A></B>(long&nbsp;docid)</CODE>
149

    
150
<BR>
151
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create an XML document from the database starting with the element 
152
 having element_id nodeid</TD>
153
</TR>
154
</TABLE>
155
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
156
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
157
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
158
<TD><B>Methods inherited from class java.lang.Object</B></TD>
159
</TR>
160
<TR BGCOLOR="white" CLASS="TableRowColor">
161
<TD><CODE>clone, 
162
equals, 
163
finalize, 
164
getClass, 
165
hashCode, 
166
notify, 
167
notifyAll, 
168
toString, 
169
wait, 
170
wait, 
171
wait</CODE></TD>
172
</TR>
173
</TABLE>
174
&nbsp;
175
<P>
176

    
177
<!-- ============ FIELD DETAIL =========== -->
178

    
179

    
180
<!-- ========= CONSTRUCTOR DETAIL ======== -->
181

    
182
<A NAME="constructor_detail"><!-- --></A>
183
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
184
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
185
<TD COLSPAN=1><FONT SIZE="+2">
186
<B>Constructor Detail</B></FONT></TD>
187
</TR>
188
</TABLE>
189

    
190
<A NAME="DBReader(java.sql.Connection)"><!-- --></A><H3>
191
DBReader</H3>
192
<PRE>
193
public <B>DBReader</B>(java.sql.Connection&nbsp;conn)
194
         throws java.io.IOException,
195
                java.sql.SQLException,
196
                java.lang.ClassNotFoundException</PRE>
197
<DL>
198
<DD>construct a DBReader instance.
199

    
200
 Generally, one calls readXMLDocument() after constructing the instance<DD><DL>
201
<DT><B>Parameters:</B><DD><CODE>conn</CODE> - the database connection from which to read the document</DL>
202
</DD>
203
</DL>
204

    
205
<!-- ============ METHOD DETAIL ========== -->
206

    
207
<A NAME="method_detail"><!-- --></A>
208
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
209
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
210
<TD COLSPAN=1><FONT SIZE="+2">
211
<B>Method Detail</B></FONT></TD>
212
</TR>
213
</TABLE>
214

    
215
<A NAME="main(java.lang.String[])"><!-- --></A><H3>
216
main</H3>
217
<PRE>
218
public static void <B>main</B>(java.lang.String[]&nbsp;args)</PRE>
219
<DL>
220
<DD>main routine used for testing.
221

    
222
 Usage: java DBReader <nodeid> <user> <password> [dbstring]<DD><DL>
223
<DT><B>Parameters:</B><DD><CODE>nodeid</CODE> - the id number of the root of the subtree to display<DD><CODE>user</CODE> - the username to use for the database connection<DD><CODE>password</CODE> - the password to use for the database connection<DD><CODE>dbstring</CODE> - the connection info to use for the database connection</DL>
224
</DD>
225
</DL>
226
<HR>
227

    
228
<A NAME="getRootNode(long)"><!-- --></A><H3>
229
getRootNode</H3>
230
<PRE>
231
public long <B>getRootNode</B>(long&nbsp;docid)</PRE>
232
<DL>
233
<DD>Get the root node id for an XML document given a document id<DD><DL>
234
<DT><B>Parameters:</B><DD><CODE>docid</CODE> - the document node contains the root of the document</DL>
235
</DD>
236
</DL>
237
<HR>
238

    
239
<A NAME="readXMLDocument(long)"><!-- --></A><H3>
240
readXMLDocument</H3>
241
<PRE>
242
public java.lang.String <B>readXMLDocument</B>(long&nbsp;docid)</PRE>
243
<DL>
244
<DD>Create an XML document from the database starting with the element 
245
 having element_id nodeid<DD><DL>
246
<DT><B>Parameters:</B><DD><CODE>docid</CODE> - the document that we want retrieved</DL>
247
</DD>
248
</DL>
249
<HR>
250

    
251
<A NAME="getDoctypeInfo(long)"><!-- --></A><H3>
252
getDoctypeInfo</H3>
253
<PRE>
254
public <A HREF="../../../../edu/ucsb/nceas/metacat/DBReader.DoctypeInfo.html">DBReader.DoctypeInfo</A> <B>getDoctypeInfo</B>(long&nbsp;docid)</PRE>
255
<DL>
256
<DD>Look up the document type information from the database<DD><DL>
257
<DT><B>Parameters:</B><DD><CODE>docid</CODE> - the id of the document to look up</DL>
258
</DD>
259
</DL>
260
<!-- ========= END OF CLASS DATA ========= -->
261
<HR>
262

    
263
<!-- ========== START OF NAVBAR ========== -->
264
<A NAME="navbar_bottom"><!-- --></A>
265
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
266
<TR>
267
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
268
<A NAME="navbar_bottom_firstrow"><!-- --></A>
269
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
270
  <TR ALIGN="center" VALIGN="top">
271
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
272
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
273
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DBReader.html"><FONT ID="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
274
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
275
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
276
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
277
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
278
  </TR>
279
</TABLE>
280
</TD>
281
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
282
</EM>
283
</TD>
284
</TR>
285

    
286
<TR>
287
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
288
&nbsp;<A HREF="../../../../edu/ucsb/nceas/metacat/DBEntityResolver.html"><B>PREV CLASS</B></A>&nbsp;
289
&nbsp;<A HREF="../../../../edu/ucsb/nceas/metacat/DBReader.DoctypeInfo.html"><B>NEXT CLASS</B></A></FONT></TD>
290
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
291
  <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
292
&nbsp;<A HREF="DBReader.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
293
</TR>
294
<TR>
295
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
296
  SUMMARY: &nbsp;<A HREF="#inner_class_summary">INNER</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
297
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
298
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
299
</TR>
300
</TABLE>
301
<!-- =========== END OF NAVBAR =========== -->
302

    
303
<HR>
304
<i>Copyright ? 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.</i>
305
</BODY>
306
</HTML>