Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b75e175

Browse files
author
Barry Lind
committed
updates to jdbc documentation for 7.2
1 parent 40ce3a9 commit b75e175

File tree

1 file changed

+45
-23
lines changed

1 file changed

+45
-23
lines changed

doc/src/sgml/jdbc.sgml

Lines changed: 45 additions & 23 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.26 2001/10/12 23:32:33 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.27 2001/10/25 22:00:31 barry Exp $
33
-->
44

55
<chapter id="jdbc">
@@ -8,8 +8,8 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.26 2001/10/12 23:32:33
88
<note>
99
<title>Author</title>
1010
<para>
11-
Written by Peter T. Mount (<email>peter@retep.org.uk</email>), the
12-
author of the <acronym>JDBC</acronym> driver.
11+
Originally written by Peter T. Mount (<email>peter@retep.org.uk</email>),
12+
the original author of the <acronym>JDBC</acronym> driver.
1313
</para>
1414
</note>
1515

@@ -41,14 +41,19 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.26 2001/10/12 23:32:33
4141
<title>Setting up the <acronym>JDBC</acronym> Driver</title>
4242

4343
<sect2 id="jdbc-build">
44-
<title>Building the Driver</title>
44+
<title>Getting the Driver</title>
4545

4646
<para>
47-
Precompiled versions of the driver are regularly made available on
47+
Precompiled versions of the driver can be downloaded from
4848
the <ulink
4949
url="http://jdbc.postgresql.org"><productname>PostgreSQL</productname>
50-
<acronym>JDBC</acronym> web site</ulink>. Here we describe how to
51-
build the driver manually.
50+
<acronym>JDBC</acronym> web site</ulink>.
51+
</para>
52+
53+
<para>
54+
Alternatively you can build the driver from source. Although you
55+
should only need to do this if you are making changes to the source
56+
code.
5257
</para>
5358

5459
<para>
@@ -70,27 +75,37 @@ JAVACMD=$JAVA_HOME/bin/java
7075
</para>
7176

7277
<para>
73-
The build the driver, add the <option>--with-java</option> option to your
78+
To build the driver, add the <option>--with-java</option> option to your
7479
<filename>configure</filename> command line, e.g.,
7580
<screen>
7681
<prompt>$</prompt> <userinput>./configure --prefix=<replaceable>xxx</replaceable> --with-java ...</userinput>
7782
</screen>
7883
This will build and install the driver along with the rest of the
7984
<productname>PostgreSQL</productname> package when you issue the
80-
<literal>gmake</literal> and <literal>gmake install</literal>
85+
<literal>make/gmake</literal> and <literal>make/gmake install</literal>
8186
commands. If you only want to build the driver and not the rest
8287
of <productname>PostgreSQL</productname>, change into the
8388
directory <filename
8489
class="directory">src/interfaces/jdbc</filename> and issue the
85-
respective <literal>make</literal> command there. Refer to the
90+
respective <literal>make/gmake</literal> command there. Refer to the
8691
<productname>PostgreSQL</productname> installation instructions
8792
for more information about the configuration and build process.
8893
</para>
8994

95+
<para>When building the driver from source the jar file that is created
96+
will be named <filename>postgresql.jar</filename>. The build will
97+
create this file in the <filename>src/interfaces/jdbc/jars</filename>
98+
directory. The resulting driver will be built for the version of
99+
Java you are running. If you build with a 1.1 JDK you will build
100+
a version that supports the jdbc1 specification, if you build with a
101+
Java2 JDK (i.e. JDK1.2 or JDK1.3) you will build a version that
102+
supports the jdbc2 specification.
103+
</para>
104+
90105
<note>
91106
<para>
92-
Do not try to build by calling <command>javac</command> directly,
93-
as the driver uses some dynamic loading techniques for
107+
Do not try to build the driver by calling <command>javac</command>
108+
directly, as the driver uses some dynamic loading techniques for
94109
performance reasons, and <command>javac</command> cannot cope.
95110
Do not try to run <command>ant</command> directly either, because
96111
some configuration information is communicated through the
@@ -104,16 +119,21 @@ JAVACMD=$JAVA_HOME/bin/java
104119
<title>Setting up the Class Path</title>
105120

106121
<para>
107-
To use the driver, the jar archive
108-
<filename>postgresql.jar</filename> needs to be included in the
122+
To use the driver, the jar archive (named
123+
<filename>postgresql.jar</filename> if you built from source, otherwise
124+
it will likely be named <filename>jdbc7.2-1.1.jar</filename> or
125+
<filename>jdbc7.2-1.2.jar</filename> for the jdbc1 and jdbc2 versions
126+
respectively)
127+
needs to be included in the
109128
class path, either by putting it in the <envar>CLASSPATH</envar>
110129
environment variable, or by using flags on the
111130
<command>java</command> command line. By default, the jar archive
112131
is installed in the directory <filename
113132
class="directory">/usr/local/pgsql/share/java</filename>. You may
114133
have it in a different directory if you used the
115134
<option>--prefix</option> option when you ran
116-
<filename>configure</filename>.
135+
<filename>configure</filename>, or if you are using a binary distribution
136+
that places it in some different location.
117137
</para>
118138

119139
<informalexample>
@@ -124,16 +144,16 @@ JAVACMD=$JAVA_HOME/bin/java
124144
<acronym>JDBC</acronym> driver installed in the <filename
125145
class="directory">/usr/local/lib</filename> directory, and the
126146
Java <acronym>JDK</acronym> installed in
127-
<filename>/usr/local/jdk1.1.6</filename>. To run the
147+
<filename>/usr/local/jdk1.3.1</filename>. To run the
128148
application, I would use:
129149
<programlisting>
130150
export CLASSPATH=/usr/local/lib/finder.jar<co id="co.jdbc-finder">:/usr/local/pgsql/share/java/postgresql.jar:.
131-
java uk.org.retep.finder.Main
151+
java Finder
132152
</programlisting>
133153
<calloutlist>
134154
<callout arearefs="co.jdbc-finder">
135155
<para>
136-
<filename>finder.jar</filename> contains my application.
156+
<filename>finder.jar</filename> contains the Finder application.
137157
</para>
138158
</callout>
139159
</calloutlist>
@@ -150,10 +170,12 @@ java uk.org.retep.finder.Main
150170
<title>Preparing the Database for <acronym>JDBC</acronym></title>
151171

152172
<para>
153-
Because Java can only use TCP/IP connections, the
154-
<application>Postgres</application> server must be configured to
155-
accept TCP/IP connections, for instance by supplying the
156-
<option>-i</option> option flag when starting the
173+
Because Java only uses TCP/IP connections, the
174+
<application>PostgreSQL</application> server must be configured to
175+
accept TCP/IP connections. This can be done by setting
176+
<literal>tcpip_socket = true</literal> in the
177+
<filename>postgresql.conf</filename> file or by supplying the
178+
<option>-i</option> option flag when starting
157179
<command>postmaster</command>.
158180
</para>
159181

@@ -162,7 +184,7 @@ java uk.org.retep.finder.Main
162184
<filename>pg_hba.conf</filename> file may need to be configured.
163185
Refer to the <citetitle>Administrator's Guide</citetitle> for
164186
details. The <acronym>JDBC</acronym> Driver supports trust,
165-
ident, password, and md5, crypt authentication methods.
187+
ident, password, md5, and crypt authentication methods.
166188
</para>
167189
</sect2>
168190
</sect1>

0 commit comments

Comments
 (0)