1
1
<!--
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 $
3
3
-->
4
4
5
5
<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
8
8
<note>
9
9
<title>Author</title>
10
10
<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.
13
13
</para>
14
14
</note>
15
15
@@ -41,14 +41,19 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.26 2001/10/12 23:32:33
41
41
<title>Setting up the <acronym>JDBC</acronym> Driver</title>
42
42
43
43
<sect2 id="jdbc-build">
44
- <title>Building the Driver</title>
44
+ <title>Getting the Driver</title>
45
45
46
46
<para>
47
- Precompiled versions of the driver are regularly made available on
47
+ Precompiled versions of the driver can be downloaded from
48
48
the <ulink
49
49
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.
52
57
</para>
53
58
54
59
<para>
@@ -70,27 +75,37 @@ JAVACMD=$JAVA_HOME/bin/java
70
75
</para>
71
76
72
77
<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
74
79
<filename>configure</filename> command line, e.g.,
75
80
<screen>
76
81
<prompt>$</prompt> <userinput>./configure --prefix=<replaceable>xxx</replaceable> --with-java ...</userinput>
77
82
</screen>
78
83
This will build and install the driver along with the rest of the
79
84
<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>
81
86
commands. If you only want to build the driver and not the rest
82
87
of <productname>PostgreSQL</productname>, change into the
83
88
directory <filename
84
89
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
86
91
<productname>PostgreSQL</productname> installation instructions
87
92
for more information about the configuration and build process.
88
93
</para>
89
94
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
+
90
105
<note>
91
106
<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
94
109
performance reasons, and <command>javac</command> cannot cope.
95
110
Do not try to run <command>ant</command> directly either, because
96
111
some configuration information is communicated through the
@@ -104,16 +119,21 @@ JAVACMD=$JAVA_HOME/bin/java
104
119
<title>Setting up the Class Path</title>
105
120
106
121
<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
109
128
class path, either by putting it in the <envar>CLASSPATH</envar>
110
129
environment variable, or by using flags on the
111
130
<command>java</command> command line. By default, the jar archive
112
131
is installed in the directory <filename
113
132
class="directory">/usr/local/pgsql/share/java</filename>. You may
114
133
have it in a different directory if you used the
115
134
<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.
117
137
</para>
118
138
119
139
<informalexample>
@@ -124,16 +144,16 @@ JAVACMD=$JAVA_HOME/bin/java
124
144
<acronym>JDBC</acronym> driver installed in the <filename
125
145
class="directory">/usr/local/lib</filename> directory, and the
126
146
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
128
148
application, I would use:
129
149
<programlisting>
130
150
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
132
152
</programlisting>
133
153
<calloutlist>
134
154
<callout arearefs="co.jdbc-finder">
135
155
<para>
136
- <filename>finder.jar</filename> contains my application.
156
+ <filename>finder.jar</filename> contains the Finder application.
137
157
</para>
138
158
</callout>
139
159
</calloutlist>
@@ -150,10 +170,12 @@ java uk.org.retep.finder.Main
150
170
<title>Preparing the Database for <acronym>JDBC</acronym></title>
151
171
152
172
<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
157
179
<command>postmaster</command>.
158
180
</para>
159
181
@@ -162,7 +184,7 @@ java uk.org.retep.finder.Main
162
184
<filename>pg_hba.conf</filename> file may need to be configured.
163
185
Refer to the <citetitle>Administrator's Guide</citetitle> for
164
186
details. The <acronym>JDBC</acronym> Driver supports trust,
165
- ident, password, and md5, crypt authentication methods.
187
+ ident, password, md5, and crypt authentication methods.
166
188
</para>
167
189
</sect2>
168
190
</sect1>
0 commit comments