📄 cursor.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Apr 06 18:48:43 GMT+04:00 2000 -->
<TITLE>
: Class Cursor
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> <FONT ID="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
<A HREF="../jora/Session.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="Cursor.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
jora</FONT>
<BR>
Class Cursor</H2>
<PRE>
java.lang.Object
|
+--<B>jora.Cursor</B>
</PRE>
<HR>
<DL>
<DT>public class <B>Cursor</B><DT>extends java.lang.Object</DL>
<P>
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>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../jora/Cursor.html#delete()">delete</A></B>()</CODE>
<BR>
Delete current record pointed by cursor. </TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../jora/Cursor.html#next()">next</A></B>()</CODE>
<BR>
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="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../jora/Cursor.html#toArray()">toArray</A></B>()</CODE>
<BR>
Store all objects returned by SELECT query into array of Object. </TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../jora/Cursor.html#toArray(int)">toArray</A></B>(int maxElements)</CODE>
<BR>
Extracts no more than <I>maxElements</I> records from database and store them into array. </TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.List</CODE></FONT></TD>
<TD><CODE><B><A HREF="../jora/Cursor.html#toArrayList()">toArrayList</A></B>()</CODE>
<BR>
Store all objects returned by SELECT query into a list of Object. </TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.List</CODE></FONT></TD>
<TD><CODE><B><A HREF="../jora/Cursor.html#toArrayList(int)">toArrayList</A></B>(int maxElements)</CODE>
<BR>
Extracts no more than <I>maxElements</I> records from database and store them into array. </TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../jora/Cursor.html#update()">update</A></B>()</CODE>
<BR>
Update current record pointed by cursor. </TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE>equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<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><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><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(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><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>
<A NAME="toArrayList(int)"><!-- --></A><H3>
toArrayList</H3>
<PRE>
public java.util.List <B>toArrayList</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>List with objects constructed from fetched records.</DL>
</DD>
</DL>
<HR>
<A NAME="toArrayList()"><!-- --></A><H3>
toArrayList</H3>
<PRE>
public java.util.List <B>toArrayList</B>()</PRE>
<DL>
<DD>Store all objects returned by SELECT query into a list 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>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> <FONT ID="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
<A HREF="../jora/Session.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="Cursor.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -