📄 jora.cursor.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Sun Jun 28 15:53:34 GMT 1998
-->
<title>
Class jora.Cursor
</title>
</head>
<body bgcolor="#FFFFFF">
<a name="_top_"></a>
<table BORDER=0 WIDTH=100%>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan=3><a href="packages.html">Contents</a> | <a href="package-jora.html">Package</a> | <b>Class</b> | <a href="package-tree-jora.html">Tree</a> | <a href="deprecatedlist.html">Deprecated</a> | <a href="index.html">Index</a> | <a href="help.html">Help</a></td>
<td align=right rowspan=2><em>
</em>
</td>
</tr>
<tr>
<td><font size="-2">
PREV | <a href="jora.Session.html">NEXT</a></font>
</td>
<td><font size="-2">
<a href="frame.html" target="_top">SHOW LISTS</a> | <a href="jora.Cursor.html" target="_top">HIDE LISTS</a></font>
</td>
<td></td>
</tr>
</table>
<hr>
<h1>
Class jora.Cursor
</h1>
<pre>
java.lang.Object
|
+----jora.Cursor
</pre>
<hr>
<dl>
<dt>public class <b>Cursor</b><dt>extends java.lang.Object</dl>
Cursor is used for successive access to records fetched by SELECT
statement. As far as records can be retrived from several derived tables
(polymorphic form of select), this class can issue several requests
to database. Cursor also provides methods for updating/deleting current
record.
<p>
<hr>
<p>
<a name="index"></a>
<p>
<p>
<p>
<table border="1" cellpadding="0" cellspacing="0" width=100%>
<tr BGCOLOR="#CCCCFF">
<td colspan=2><font size="+2">
<b>Method Summary</b></font>
</td>
</tr>
<tr BGCOLOR="#FFFFCC">
<td align=right valign=top width=1%><font size="-1">
void</font>
</td>
<td> <b><a href="#delete()">delete</a></b>()
<br>
<dd>Delete current record pointed by cursor.
</td>
</tr>
<tr BGCOLOR="#FFFFCC">
<td align=right valign=top width=1%><font size="-1">
java.lang.Object</font>
</td>
<td> <b><a href="#next()">next</a></b>()
<br>
<dd>A cursor is initially positioned before its first row; the
first call to next makes the first row the current row; the
second call makes the second row the current row, etc.
</td>
</tr>
<tr BGCOLOR="#FFFFCC">
<td align=right valign=top width=1%><font size="-1">
java.lang.Object[]</font>
</td>
<td> <b><a href="#toArray(int)">toArray</a></b>(int maxElements)
<br>
<dd>Extracts no more than <I>maxElements</I> records from database and
store them into array.
</td>
</tr>
<tr BGCOLOR="#FFFFCC">
<td align=right valign=top width=1%><font size="-1">
java.lang.Object[]</font>
</td>
<td> <b><a href="#toArray()">toArray</a></b>()
<br>
<dd>Store all objects returned by SELECT query into array of Object.
</td>
</tr>
<tr BGCOLOR="#FFFFCC">
<td align=right valign=top width=1%><font size="-1">
void</font>
</td>
<td> <b><a href="#update()">update</a></b>()
<br>
<dd>Update current record pointed by cursor.
</td>
</tr>
</table>
<table border="1" cellpadding="0" cellspacing="0" width=100%>
<td colspan=2><b>Methods inherited from class java.lang.Object</b></font>
</td>
</tr>
<tr BGCOLOR="#FFFFCC">
<td> equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</td>
</tr>
</table>
<p>
<a name="methods"></a><table border="1" cellpadding="3" cellspacing="0" width=100%>
<tr BGCOLOR="#CCFFCC">
<td colspan=1><font size="+2">
<b>Method Detail</b></font>
</td>
</tr>
</table>
<a name="next"></a><a name="next()"></a><h3>
next</h3>
<pre>
public java.lang.Object <b>next</b>()</pre>
<dl>
<dd>A cursor is initially positioned before its first row; the
first call to next makes the first row the current row; the
second call makes the second row the current row, etc.
<P>If an input stream from the previous row is open, it is
implicitly closed. The ResultSet's warning chain is cleared
when a new row is read.<dd><dl>
<dt><b>Returns:</b><dd>object constructed from fetched record or null if there
are no more rows</dl>
</dd>
</dl>
<hr>
<a name="update"></a><a name="update()"></a><h3>
update</h3>
<pre>
public void <b>update</b>()</pre>
<dl>
<dd>Update current record pointed by cursor. This method can be called
only after next() method, which returns non-null object. This objects
is used to update current record fields.<P>
If you are going to update or delete selected records, you should add
"for update" clause to select statement. So parameter of
<CODE>jora.Table.select()</CODE> statement should contain "for update"
clause:
<CODE>record.table.Select("where name='xyz' for update");</CODE><P>
<I><B>Attention!</I></B>
Not all database drivers support update operation with
cursor. This method will not work with such database drivers.</dl>
<hr>
<a name="delete"></a><a name="delete()"></a><h3>
delete</h3>
<pre>
public void <b>delete</b>()</pre>
<dl>
<dd>Delete current record pointed by cursor. This method can be called
only after next() method, which returns non-null object.<P>
If you are going to update or delete selected records, you should add
"for update" clause to select statement. So parameter of
<CODE>jora.Table.select()</CODE> statement should contain "for update"
clause:
<CODE>record.table.Select("where name='xyz' for update");</CODE><P>
<I><B>Attention!</I></B>
Not all database drivers support delete operation with cursor.
This method will not work with such database drivers.</dl>
<hr>
<a name="toArray"></a><a name="toArray(int)"></a><h3>
toArray</h3>
<pre>
public java.lang.Object[] <b>toArray</b>(int maxElements)</pre>
<dl>
<dd>Extracts no more than <I>maxElements</I> records from database and
store them into array. It is possible to extract rest records
by successive next() or toArray() calls. Selected objects should
have now components of InputStream, Blob or Clob type, because
their data will be not available after fetching next record.<dd><dl>
<dt><b>Parameters:</b><dd><code>
maxElements</code>
- limitation for result array size (and also for number
of fetched records)
<dt><b>Returns:</b><dd>Array with objects constructed from fetched records.</dl>
</dd>
</dl>
<hr>
<a name="toArray"></a><a name="toArray()"></a><h3>
toArray</h3>
<pre>
public java.lang.Object[] <b>toArray</b>()</pre>
<dl>
<dd>Store all objects returned by SELECT query into array of Object.
Selected objects should have now components of InputStream, Blob or
Clob type, because their data will be not available after fetching
next record.<dd><dl>
<dt><b>Returns:</b><dd>Array with objects constructed from fetched records.</dl>
</dd>
</dl>
<hr>
<table BORDER=0 WIDTH=100%>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan=3><a href="packages.html">Contents</a> | <a href="package-jora.html">Package</a> | <b>Class</b> | <a href="package-tree-jora.html">Tree</a> | <a href="deprecatedlist.html">Deprecated</a> | <a href="index.html">Index</a> | <a href="help.html">Help</a></td>
<td align=right rowspan=2><em>
</em>
</td>
</tr>
<tr>
<td><font size="-2">
PREV | <a href="jora.Session.html">NEXT</a></font>
</td>
<td><font size="-2">
<a href="frame.html" target="_top">SHOW LISTS</a> | <a href="jora.Cursor.html" target="_top">HIDE LISTS</a></font>
</td>
<td></td>
</tr>
</table>
<hr>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -