Skip to content

Commit 4ac5534

Browse files
author
Barry Lind
committed
formating and spelling fixes to my last doc update
1 parent d7decc6 commit 4ac5534

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

doc/src/sgml/jdbc.sgml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.31 2001/11/26 19:07:11 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.32 2001/11/27 01:20:17 barry Exp $
33
-->
44

55
<chapter id="jdbc">
@@ -379,9 +379,8 @@ db.close();
379379
Any time you want to issue <acronym>SQL</acronym> statements to
380380
the database, you require a <classname>Statement</classname> or
381381
<classname>PreparedStatement</classname> instance. Once you have
382-
a <classname>Statement</classname> or <classname>PreparedStatement
383-
</classname>, you
384-
can use issue a
382+
a <classname>Statement</classname> or
383+
<classname>PreparedStatement</classname>, you can use issue a
385384
query. This will return a <classname>ResultSet</classname>
386385
instance, which contains the entire result. <xref
387386
linkend="jdbc-query-example"> illustrates this process.
@@ -406,7 +405,7 @@ st.close();
406405
</para>
407406

408407
<para>
409-
This example will issues the same query as before using
408+
This example will issue the same query as before using
410409
a <classname>PreparedStatement</classname>
411410
and a bind value in the query.
412411
<programlisting>
@@ -430,7 +429,8 @@ st.close();
430429

431430
<para>
432431
The following must be considered when using the
433-
<classname>Statement</classname> interface:
432+
<classname>Statement</classname> or
433+
<classname>PreparedStatement</classname> interface:
434434

435435
<itemizedlist>
436436
<listitem>
@@ -440,7 +440,8 @@ st.close();
440440
open the connection and use it for the connection's
441441
lifetime. But you have to remember that only one
442442
<classname>ResultSet</classname> can exist per
443-
<classname>Statement</classname> at a given time.
443+
<classname>Statement</classname> or
444+
<classname>PreparedStatement</classname> at a given time.
444445
</para>
445446
</listitem>
446447

@@ -464,7 +465,8 @@ st.close();
464465
<listitem>
465466
<para>
466467
When you are done using the <classname>Statement</classname>
467-
you should close the <classname>Statement</classname>.
468+
or <classname>PreparedStatement</classname>
469+
you should close it.
468470
</para>
469471
</listitem>
470472
</itemizedlist>
@@ -532,6 +534,8 @@ st.close();
532534
update, or delete statement.
533535
</para>
534536

537+
<example id="jdbc-delete-example">
538+
<title>Simple Delete Example</title>
535539
<para>
536540
This example will issue a simple delete and print out the number
537541
of rows deleted.
@@ -544,6 +548,7 @@ System.out.println(rowsDeleted + " rows deleted");
544548
st.close();
545549
</programlisting>
546550
</para>
551+
</example>
547552
</sect1>
548553

549554
<sect1 id="jdbc-ddl">
@@ -557,6 +562,8 @@ st.close();
557562
however it doesn't return a result.
558563
</para>
559564

565+
<example id="jdbc-drop-table-example">
566+
<title>Drop Table Example</title>
560567
<para>
561568
This example will drop a table.
562569
<programlisting>
@@ -565,18 +572,20 @@ ResultSet rs = st.executeQuery("DROP TABLE mytable");
565572
st.close();
566573
</programlisting>
567574
</para>
575+
</example>
568576
</sect1>
569577

570578
<sect1 id="jdbc-binary-data">
571579
<title>Storing Binary Data</title>
572580

573581
<para>
574-
<application>PostgreSQL</application> provides two distinct way to
582+
<application>PostgreSQL</application> provides two distinct ways to
575583
store binary data. Binary data can be stored in a table using
576584
<application>PostgreSQL's</application> binary datatype
577585
<type>bytea</type>, or by using the <firstterm>Large Object</firstterm>
578586
feature which stores the binary data in a separate table in a special
579-
format, and refers to from your own tables by an <type>OID</type> value.
587+
format, and refers to that table by storing a value of type
588+
<type>OID</type> in your table.
580589
</para>
581590

582591
<para>
@@ -598,8 +607,8 @@ st.close();
598607
</para>
599608

600609
<para>
601-
7.2 is the first release that the <acronym>JDBC</acronym> Driver
602-
supports the <type>bytea</type> datatype. The introduction of
610+
7.2 is the first release of the <acronym>JDBC</acronym> Driver
611+
that supports the <type>bytea</type> datatype. The introduction of
603612
this functionality in 7.2 has introduced a change in behavior
604613
as compared to previous releases. In 7.2 the methods
605614
<function>getBytes()</function>, <function>setBytes()</function>,
@@ -702,7 +711,7 @@ ps.close();
702711
</para>
703712

704713
<para>
705-
Here you can see how the Large Object is retrieved as an
714+
Here the binary data was retrieved as an
706715
<classname>byte[]</classname>. You could have used a
707716
<classname>InputStream</classname> object instead.
708717
</para>
@@ -721,6 +730,8 @@ CREATE TABLE imagesLO (imgname text, imgOID OID);
721730
<programlisting>
722731
// All LargeObject API calls must be within a transaction
723732
conn.setAutoCommit(false);
733+
734+
// Get the Large Object Manager to perform operations with
724735
LargeObjectManager lobj = ((org.postgresql.Connection)conn).getLargeObjectAPI();
725736

726737
//create a new large object
@@ -760,6 +771,8 @@ fis.close();
760771
<programlisting>
761772
// All LargeObject API calls must be within a transaction
762773
conn.setAutoCommit(false);
774+
775+
// Get the Large Object Manager to perform operations with
763776
LargeObjectManager lobj = ((org.postgresql.Connection)conn).getLargeObjectAPI();
764777

765778
PreparedStatement ps = con.prepareStatement("SELECT imgOID FROM imagesLO WHERE imgname=?");
@@ -775,7 +788,7 @@ if (rs != null) {
775788
byte buf[] = new byte[obj.size()];
776789
obj.read(buf, 0, obj.size());
777790
//do something with the data read here
778-
}
791+
779792
// Close the object
780793
obj.close();
781794
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy