db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scotsmat...@apache.org
Subject svn commit: r575524 - /db/derby/docs/trunk/src/ref/rrefjavsqlprst.dita
Date Fri, 14 Sep 2007 04:00:20 GMT
Author: scotsmatrix
Date: Thu Sep 13 21:00:20 2007
New Revision: 575524

URL: http://svn.apache.org/viewvc?rev=575524&view=rev
Log:
Derby-2971: Updated column titles for better usability. Patch was contributed by me.

Modified:
    db/derby/docs/trunk/src/ref/rrefjavsqlprst.dita

Modified: db/derby/docs/trunk/src/ref/rrefjavsqlprst.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefjavsqlprst.dita?rev=575524&r1=575523&r2=575524&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefjavsqlprst.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefjavsqlprst.dita Thu Sep 13 21:00:20 2007
@@ -1,4 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
+ "../dtd/reference.dtd">
 <!-- 
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
@@ -15,14 +18,13 @@
 See the License for the specific language governing permissions and  
 limitations under the License.
 -->
-
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
- "../dtd/reference.dtd">
 <reference id="rrefjavsqlprst" xml:lang="en-us">
 <title>Prepared statements and streaming columns </title>
 <prolog><metadata>
 <keywords><indexterm>setXXXStream requests</indexterm><indexterm>Streaming
 columns<indexterm>as IN parameters to prepared statement</indexterm></indexterm>
+<indexterm>setBinaryStream</indexterm><indexterm>setAsciiStream</indexterm>
+<indexterm>setUnicodeStream</indexterm><indexterm>Unicode<indexterm>setUnicodeStream</indexterm></indexterm>
 </keywords>
 </metadata></prolog>
 <refbody>
@@ -30,41 +32,31 @@
 and the database.</p></section>
 <section><p>JDBC allows an IN parameter to be set to a Java input stream for
 passing in large amounts of data in smaller chunks. When the statement is
-executed, the JDBC driver makes repeated calls to this input stream, reading
-its contents and transmitting those contents as the parameter data.</p></section>
-<section><p><indexterm>setBinaryStream</indexterm><ph conref="../conrefs.dita#prod/productshortname"></ph>
supports
+run, the JDBC driver makes repeated calls to this input stream.<ph conref="../conrefs.dita#prod/productshortname"></ph>
supports
 the three types of streams that JDBC 1.2 provides. These three streams are:
   <ul>
-<li><i>setBinaryStream</i><indexterm>setBinaryStream</indexterm>
<p>for streams
-containing uninterpreted bytes</p></li>
-<li><i><ph><indexterm>setAsciiStream</indexterm></ph>setAsciiStream</i>
  <p>for
-streams containing ASCII characters</p></li>
-<li><i><ph><indexterm>setUnicodeStream</indexterm></ph><ph><indexterm>Unicode<indexterm>setUnicodeStream</indexterm></indexterm></ph>setUnicodeStream</i
->   <p>for streams containing Unicode characters</p></li>
-</ul></p></section>
-<section><p><indexterm>Stream</indexterm>JDBC 2.0 and JDBC 3.0 require
that you specify the
-length of the stream and <ph conref="../conrefs.dita#prod/productshortname"></ph>
-enforces this requirement if your application runs on JDK 1.5 or earlier. If your application
runs
-on JDK 1.6, then <ph conref="../conrefs.dita#prod/productshortname"></ph> exposes
a JDBC
-4.0 implementation, which
-lets you use the streaming interfaces without having to specify the
-stream length.
-The stream object passed to these three methods can
-be either a standard Java stream object or the user's own subclass that implements
-the standard <i>java.io.InputStream</i> interface.</p></section>
-<section><p>According to the JDBC standard, streams can be stored only in
-columns of the data types shown in <xref href="rrefjavsqlprst.dita#rrefjavsqlprst/jdbc25312"></xref>.
-Streams cannot be stored in columns of the other built-in data types or of
-user-defined data types.   <table colsep="0" frame="none" id="jdbc25312" rowsep="0">
-<title>Streamable JDBC Data Types</title>
+<li><i>setBinaryStream</i> <p>Use for streams that contain uninterpreted
bytes</p></li>
+<li><i>setAsciiStream</i>   <p>Use for streams that contain ASCII
characters</p></li>
+<li><i>setUnicodeStream</i>   <p>Use for streams that contain Unicode
characters</p></li>
+</ul></p><p>JDBC 2.0 and JDBC 3.0 require that you specify the length of
the
+stream and <ph conref="../conrefs.dita#prod/productshortname"></ph> enforces
+this requirement if your application runs on JDK 1.5 or earlier. If your application
+runs on JDK 1.6, then <ph conref="../conrefs.dita#prod/productshortname"></ph>
exposes
+a JDBC 4.0 implementation, which lets you use the streaming interfaces without
+having to specify the stream length. The stream object passed to these three
+methods can be either a standard Java stream object or the user's own subclass
+that implements the standard <i>java.io.InputStream</i> interface.</p><p>According
+to the JDBC standard, streams can be stored only in columns with the data
+types shown in the following table.<table frame="all" id="jdbc25312"><title>Streamable
+JDBC Data Types</title>
 <tgroup cols="5" colsep="1" rowsep="1"><colspec colname="1" colnum="1" colwidth="22*"/>
 <colspec colname="colspec0" colnum="2" colwidth="22*"/><colspec colname="2"
 colnum="3" colwidth="15*"/><colspec colname="3" colnum="4" colwidth="18*"/>
 <colspec colname="4" colnum="5" colwidth="20*"/>
 <thead>
 <row>
-<entry colname="1">Column Values</entry>
-<entry colname="colspec0">Type Correspondent</entry>
+<entry colname="1">Column Data Type </entry>
+<entry colname="colspec0">Corresponding Java Type</entry>
 <entry colname="2">AsciiStream</entry>
 <entry colname="3">UnicodeStream</entry>
 <entry colname="4">BinaryStream</entry>
@@ -129,15 +121,18 @@
 </row>
 </tbody>
 </tgroup>
-</table></p></section>
-<section><p>A large X indicates the preferred target data type for the type
-of stream. (See <xref href="rrefjdbc20377.dita#rrefjdbc20377/jdbc31241"></xref>.)
-  <note>If the stream is stored in a column of a type other than LONG VARCHAR
+</table></p><note><ul>
+<li>A large X indicates the preferred target data type for the type of stream.
+See <xref href="rrefjdbc20377.dita#rrefjdbc20377/jdbc31241"></xref></li>
+<li>If the stream is stored in a column of a type other than LONG VARCHAR
 or LONG VARCHAR FOR BIT DATA, the entire stream must be able to fit into memory
 at one time. Streams stored in LONG VARCHAR and LONG VARCHAR FOR BIT DATA
-columns do not have this limitation.</note></p></section>
-<section><p>The following example shows how a user can store a streamed <i>java.io.File</i>
in
-a LONG VARCHAR column:   <codeblock expanse="column"><b>Statement s = conn.createStatement();
+columns do not have this limitation.</li>
+<li>Streams cannot be stored in columns of the other built-in data types or
+columns of user-defined data types.   </li>
+</ul></note></section>
+<example><title>Example</title><p>The following example shows how
a user can
+store a streamed <i>java.io.File</i> in a LONG VARCHAR column:   <codeblock>Statement
s = conn.createStatement();
 s.executeUpdate("CREATE TABLE atable (a INT, b LONG VARCHAR)");
 conn.commit();
 java.io.File file = new java.io.File("derby.txt");
@@ -150,7 +145,6 @@
 <b>// set the value of the input parameter to the input stream</b>
 ps.setAsciiStream(2, fin, fileLength);
 ps.execute();
-conn.commit();</b></codeblock></p></section>
+conn.commit();</codeblock></p></example>
 </refbody>
 </reference>
-



Mime
View raw message