Minor jdbc doc updates submitted by Kris Jurka
Modified Files: sgml/jdbc.sgml
This commit is contained in:
parent
9af05a9d10
commit
a3cac5a3bf
|
@ -1,5 +1,5 @@
|
||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.44 2003/04/07 01:29:25 petere Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.45 2003/06/30 16:39:42 barry Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<chapter id="jdbc">
|
<chapter id="jdbc">
|
||||||
|
@ -33,7 +33,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.44 2003/04/07 01:29:25
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This section describes the steps you need to take before you can
|
This section describes the steps you need to take before you can
|
||||||
write or run programs that use the JDBC interface.
|
write or run programs that use the <acronym>JDBC</> interface.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<sect2 id="jdbc-build">
|
<sect2 id="jdbc-build">
|
||||||
|
@ -49,15 +49,17 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.44 2003/04/07 01:29:25
|
||||||
<para>
|
<para>
|
||||||
Alternatively you can build the driver from source, but you should
|
Alternatively you can build the driver from source, but you should
|
||||||
only need to do this if you are making changes to the source code.
|
only need to do this if you are making changes to the source code.
|
||||||
For details, refer to the <productname>PostgreSQL</> installation
|
For details, refer to the <productname>PostgreSQL</>
|
||||||
instructions. After installation, the driver should be found in
|
<link linkend="installation">installation instructions</link>.
|
||||||
|
After installation, the driver should be found in
|
||||||
<filename><replaceable>PREFIX</>/share/java/postgresql.jar</filename>.
|
<filename><replaceable>PREFIX</>/share/java/postgresql.jar</filename>.
|
||||||
The resulting driver will be built for the version of Java you are
|
The resulting driver will be built for the version of Java you are
|
||||||
running. If you build with a 1.1 <acronym>JDK</> you will build a
|
running. If you build with a 1.1 <acronym>JDK</> you will build a
|
||||||
version that supports the JDBC 1 specification, if you build with
|
version that supports the <acronym>JDBC</> 1 specification, if you build
|
||||||
a Java 2 <acronym>JDK</> (e.g., <acronym>JDK</> 1.2 or
|
with a 1.2 or 1.3 <acronym>JDK</> you will build a version that supports
|
||||||
<acronym>JDK</> 1.3) you will build a version that supports the
|
the <acronym>JDBC</> 2 specification, and finally if you build with a
|
||||||
JDBC 2 specification.
|
1.4 <acronym>JDK</acronym> you will build a version that supports the
|
||||||
|
<acronym>JDBC</> 3 specification.
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
|
@ -67,12 +69,12 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.44 2003/04/07 01:29:25
|
||||||
<para>
|
<para>
|
||||||
To use the driver, the JAR archive (named
|
To use the driver, the JAR archive (named
|
||||||
<filename>postgresql.jar</filename> if you built from source, otherwise
|
<filename>postgresql.jar</filename> if you built from source, otherwise
|
||||||
it will likely be named <filename>jdbc&majorversion;-1.1.jar</filename> or
|
it will likely be named <filename>pg&majorversion;jdbc1.jar</filename>,
|
||||||
<filename>jdbc&majorversion;-1.2.jar</filename> for the JDBC 1 and JDBC 2 versions
|
<filename>pg&majorversion;jdbc2.jar</filename>, or
|
||||||
respectively)
|
<filename>pg&majorversion;jdbc3.jar</filename> for the <acronym>JDBC</> 1,
|
||||||
needs to be included in the
|
<acronym>JDBC</> 2, and <acronym>JDBC</> 3 versions respectively)
|
||||||
class path, either by putting it in the <envar>CLASSPATH</envar>
|
needs to be included in the class path, either by putting it in the
|
||||||
environment variable, or by using flags on the
|
<envar>CLASSPATH</envar> environment variable, or by using flags on the
|
||||||
<command>java</command> command line.
|
<command>java</command> command line.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -81,7 +83,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.44 2003/04/07 01:29:25
|
||||||
<acronym>JDBC</acronym> driver to access a database, and that
|
<acronym>JDBC</acronym> driver to access a database, and that
|
||||||
application is installed as
|
application is installed as
|
||||||
<filename>/usr/local/lib/myapp.jar</filename>. The PostgreSQL
|
<filename>/usr/local/lib/myapp.jar</filename>. The PostgreSQL
|
||||||
JDBC driver installed as
|
<acronym>JDBC</> driver installed as
|
||||||
<filename>/usr/local/pgsql/share/java/postgresql.jar</>. To run
|
<filename>/usr/local/pgsql/share/java/postgresql.jar</>. To run
|
||||||
the application, we would use:
|
the application, we would use:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
@ -113,8 +115,9 @@ java MyApp
|
||||||
Also, the client authentication setup in the
|
Also, the client authentication setup in the
|
||||||
<filename>pg_hba.conf</filename> file may need to be configured.
|
<filename>pg_hba.conf</filename> file may need to be configured.
|
||||||
Refer to <xref linkend="client-authentication"> for details. The
|
Refer to <xref linkend="client-authentication"> for details. The
|
||||||
<acronym>JDBC</acronym> driver supports the trust, ident,
|
<acronym>JDBC</acronym> driver supports the <literal>trust</>,
|
||||||
password, md5, and crypt authentication methods.
|
<literal>ident</>, <literal>password</>, <literal>md5</>, and
|
||||||
|
<literal>crypt</> authentication methods.
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
@ -123,8 +126,8 @@ java MyApp
|
||||||
<title>Initializing the Driver</title>
|
<title>Initializing the Driver</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This section describes how to load and initialize the JDBC driver
|
This section describes how to load and initialize the <acronym>JDBC</>
|
||||||
in your programs.
|
driver in your programs.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<sect2 id="jdbc-import">
|
<sect2 id="jdbc-import">
|
||||||
|
@ -252,7 +255,10 @@ jdbc:postgresql://<replaceable class="parameter">host</replaceable>:<replaceable
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The host name of the server. Defaults to <literal>localhost</literal>.
|
The host name of the server. Defaults to <literal>localhost</literal>. To specify an IPv6 address your must enclose the <replaceable class="parameter">host</replaceable> parameter with square brackets, for example:
|
||||||
|
<programlisting>
|
||||||
|
jdbc:postgresql://[::1]:5740/accounting
|
||||||
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -451,16 +457,6 @@ st.close();
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
<classname>ResultSet</classname> is currently read only.
|
|
||||||
You can not update data through the <classname>ResultSet</classname>.
|
|
||||||
If you want to update data you need to do it the normal way
|
|
||||||
by using the <acronym>SQL</acronym> statement <command>UPDATE</command>. This is
|
|
||||||
in conformance with the <acronym>JDBC</acronym> specification
|
|
||||||
which does not require drivers to provide updatable result sets.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
@ -606,11 +602,11 @@ st.close();
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<xref linkend="jdbc-binary-data-example"> contains some examples on
|
<xref linkend="jdbc-binary-data-example"> contains some examples on
|
||||||
how to process binary data using the PostgreSQL JDBC driver.
|
how to process binary data using the PostgreSQL <acronym>JDBC</> driver.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<example id="jdbc-binary-data-example">
|
<example id="jdbc-binary-data-example">
|
||||||
<title>Processing Binary Data in JDBC</title>
|
<title>Processing Binary Data in <acronym>JDBC</></title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
For example, suppose you have a table containing the file names of
|
For example, suppose you have a table containing the file names of
|
||||||
|
@ -2490,12 +2486,13 @@ public void unlink(int oid) throws SQLException
|
||||||
<title>Connection Pools and Data Sources</title>
|
<title>Connection Pools and Data Sources</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
JDBC 2 introduced standard connection pooling features in an
|
<acronym>JDBC</> 2 introduced standard connection pooling features in an
|
||||||
add-on API known as the <acronym>JDBC</acronym> 2.0 Optional
|
add-on <acronym>API</> known as the <acronym>JDBC</acronym> 2.0 Optional
|
||||||
Package (also known as the <acronym>JDBC</acronym> 2.0
|
Package (also known as the <acronym>JDBC</acronym> 2.0
|
||||||
Standard Extension). These features have since been included in
|
Standard Extension). These features have since been included in
|
||||||
the core JDBC 3 API. The <productname>PostgreSQL</productname>
|
the core <acronym>JDBC</> 3 <acronym>API</>. The
|
||||||
<acronym>JDBC</acronym> drivers support these features if it has been compiled with
|
<productname>PostgreSQL</productname> <acronym>JDBC</acronym> drivers
|
||||||
|
support these features if it has been compiled with
|
||||||
<acronym>JDK</acronym> 1.3.x in combination with the
|
<acronym>JDK</acronym> 1.3.x in combination with the
|
||||||
<acronym>JDBC</acronym> 2.0 Optional Package
|
<acronym>JDBC</acronym> 2.0 Optional Package
|
||||||
(<acronym>JDBC</acronym> 2), or with <acronym>JDK</acronym> 1.4 or higher
|
(<acronym>JDBC</acronym> 2), or with <acronym>JDK</acronym> 1.4 or higher
|
||||||
|
@ -2510,7 +2507,7 @@ public void unlink(int oid) throws SQLException
|
||||||
<title>Overview</title>
|
<title>Overview</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <acronym>JDBC</acronym> API provides a client
|
The <acronym>JDBC</acronym> <acronym>API</> provides a client
|
||||||
and a server interface for connection pooling. The client
|
and a server interface for connection pooling. The client
|
||||||
interface is <literal>javax.sql.DataSource</literal>,
|
interface is <literal>javax.sql.DataSource</literal>,
|
||||||
which is what application code will typically use to
|
which is what application code will typically use to
|
||||||
|
|
Loading…
Reference in New Issue