Project

General

Profile

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

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 Sat May 20 14:25:41 AKDT 2000 -->
6
<TITLE>
7
: 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="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
24
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
25
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
26
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
27
  </TR>
28
</TABLE>
29
</TD>
30
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
31
</EM>
32
</TD>
33
</TR>
34

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

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

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

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

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

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

    
95

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

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

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

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

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

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

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

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

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

    
178

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

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

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

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

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

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

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

    
221
 Usage: java DBReader <nodeid> <user> <password> [dbstring]<DD><DL>
222
<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>
223
</DD>
224
</DL>
225
<HR>
226

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

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

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

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

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

    
301
<HR>
302

    
303
</BODY>
304
</HTML>