Skip to content

Commit ba977c0

Browse files
committed
Peter's Mega-Patch for JDBC...
see README_6.3 for list of changes
1 parent 4bad5be commit ba977c0

13 files changed

+1276
-306
lines changed

src/interfaces/jdbc/Makefile

Lines changed: 88 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for Java JDBC interface
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.2 1997/09/29 20:11:42 scrappy Exp $
7+
# $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.3 1998/01/11 21:14:29 scrappy Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -22,41 +22,70 @@ RM = rm -f
2222
$(JAVAC) $<
2323

2424
.SUFFIXES: .class .java
25-
.PHONY: all clean doc
25+
.PHONY: all clean doc examples
2626

2727
all: postgresql.jar
28+
@echo ------------------------------------------------------------
29+
@echo The JDBC driver has now been built. To make it available to
30+
@echo other applications, copy the postgresql.jar file to a public
31+
@echo "place (under unix this could be /usr/local/lib) and add it"
32+
@echo to the class path.
33+
@echo
34+
@echo Then either add -Djdbc.drivers=postgresql.Driver to the
35+
@echo commandline when running your application, or edit the
36+
@echo "properties file (~/.hotjava/properties under unix), and"
37+
@echo add a line containing jdbc.drivers=postgresql.Driver
38+
@echo
39+
@echo More details are in the README file.
40+
@echo ------------------------------------------------------------
41+
@echo To build the examples, type:
42+
@echo " make examples"
43+
@echo ------------------------------------------------------------
44+
@echo
2845

46+
# This rule builds the javadoc documentation
2947
doc:
30-
$(JAVADOC) -public postgresql
48+
export CLASSPATH=.;\
49+
$(JAVADOC) -public \
50+
postgresql \
51+
postgresql.fastpath \
52+
postgresql.largeobject
3153

54+
# These classes form the driver. These, and only these are placed into
55+
# the jar file.
3256
OBJS= postgresql/CallableStatement.class \
3357
postgresql/Connection.class \
3458
postgresql/DatabaseMetaData.class \
3559
postgresql/Driver.class \
3660
postgresql/Field.class \
37-
postgresql/PG_Object.class \
3861
postgresql/PG_Stream.class \
39-
postgresql/PGbox.class \
40-
postgresql/PGcircle.class \
41-
postgresql/PGlobj.class \
42-
postgresql/PGlseg.class \
43-
postgresql/PGpath.class \
44-
postgresql/PGpoint.class \
45-
postgresql/PGpolygon.class \
46-
postgresql/PGtokenizer.class \
4762
postgresql/PreparedStatement.class \
4863
postgresql/ResultSet.class \
4964
postgresql/ResultSetMetaData.class \
50-
postgresql/Statement.class
65+
postgresql/Statement.class \
66+
postgresql/fastpath/Fastpath.class \
67+
postgresql/fastpath/FastpathArg.class \
68+
postgresql/geometric/PGbox.class \
69+
postgresql/geometric/PGcircle.class \
70+
postgresql/geometric/PGlseg.class \
71+
postgresql/geometric/PGpath.class \
72+
postgresql/geometric/PGpoint.class \
73+
postgresql/geometric/PGpolygon.class \
74+
postgresql/largeobject/LargeObject.class \
75+
postgresql/largeobject/LargeObjectManager.class \
76+
postgresql/util/PGobject.class \
77+
postgresql/util/PGtokenizer.class
5178

5279
postgresql.jar: $(OBJS)
53-
$(JAR) -c0vf $@ $^
80+
$(JAR) -c0vf $@ $$($(FIND) postgresql -name "*.class" -print)
5481

5582
# This rule removes any temporary and compiled files from the source tree.
5683
clean:
5784
$(FIND) . -name "*~" -exec $(RM) {} \;
5885
$(FIND) . -name "*.class" -exec $(RM) {} \;
86+
$(FIND) . -name "*.html" -exec $(RM) {} \;
5987
$(RM) postgresql.jar
88+
-$(RM) -rf Package-postgresql *output
6089

6190
#######################################################################
6291
# This helps make workout what classes are from what source files
@@ -69,21 +98,56 @@ postgresql/Connection.class: postgresql/Connection.java
6998
postgresql/DatabaseMetaData.class: postgresql/DatabaseMetaData.java
7099
postgresql/Driver.class: postgresql/Driver.java
71100
postgresql/Field.class: postgresql/Field.java
72-
postgresql/PG_Object.class: postgresql/PG_Object.java
73101
postgresql/PG_Stream.class: postgresql/PG_Stream.java
74-
postgresql/PGbox.class: postgresql/PGbox.java
75-
postgresql/PGcircle.class: postgresql/PGcircle.java
76-
postgresql/PGlobj.class: postgresql/PGlobj.java
77-
postgresql/PGlseg.class: postgresql/PGlseg.java
78-
postgresql/PGpath.class: postgresql/PGpath.java
79-
postgresql/PGpoint.class: postgresql/PGpoint.java
80-
postgresql/PGpolygon.class: postgresql/PGpolygon.java
81-
postgresql/PGtokenizer.class: postgresql/PGtokenizer.java
82102
postgresql/PreparedStatement.class: postgresql/PreparedStatement.java
83103
postgresql/ResultSet.class: postgresql/ResultSet.java
84104
postgresql/ResultSetMetaData.class: postgresql/ResultSetMetaData.java
85105
postgresql/Statement.class: postgresql/Statement.java
106+
postgresql/fastpath/Fastpath.class: postgresql/fastpath/Fastpath.java
107+
postgresql/fastpath/FastpathArg.class: postgresql/fastpath/FastpathArg.java
108+
postgresql/geometric/PGbox.class: postgresql/geometric/PGbox.java
109+
postgresql/geometric/PGcircle.class: postgresql/geometric/PGcircle.java
110+
postgresql/geometric/PGlseg.class: postgresql/geometric/PGlseg.java
111+
postgresql/geometric/PGpath.class: postgresql/geometric/PGpath.java
112+
postgresql/geometric/PGpoint.class: postgresql/geometric/PGpoint.java
113+
postgresql/geometric/PGpolygon.class: postgresql/geometric/PGpolygon.java
114+
postgresql/largeobject/LargeObject.class: postgresql/largeobject/LargeObject.java
115+
postgresql/largeobject/LargeObjectManager.class: postgresql/largeobject/LargeObjectManager.java
116+
postgresql/util/PGobject.class: postgresql/util/PGobject.java
117+
postgresql/util/PGtokenizer.class: postgresql/util/PGtokenizer.java
86118

119+
#######################################################################
120+
# These classes are in the example directory, and form the examples
121+
EX= example/basic.class \
122+
example/blobtest.class \
123+
example/datestyle.class \
124+
example/psql.class \
125+
example/ImageViewer.class
87126

127+
# This rule builds the examples
128+
examples: postgresql.jar $(EX)
129+
@echo ------------------------------------------------------------
130+
@echo The examples have been built.
131+
@echo
132+
@echo For instructions on how to use them, simply run them. For example:
133+
@echo
134+
@echo " java example.blobtest"
135+
@echo
136+
@echo This would display instructions on how to run the example.
137+
@echo ------------------------------------------------------------
138+
@echo Available examples:
139+
@echo
140+
@echo " example.basic Basic JDBC useage"
141+
@echo " example.blobtest Binary Large Object tests"
142+
@echo " example.datestyle Shows how datestyles are handled"
143+
@echo " example.ImageViewer Example application storing images"
144+
@echo " example.psql Simple java implementation of psql"
145+
@echo ------------------------------------------------------------
146+
@echo
88147

89-
148+
example/basic.class: example/basic.java
149+
example/blobtest.class: example/blobtest.java
150+
example/datestyle.class: example/datestyle.java
151+
example/psql.class: example/psql.java
152+
example/ImageViewer.class: example/ImageViewer.java
153+
#######################################################################

src/interfaces/jdbc/README

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ or the JDBC mailing list:
1010

1111
http://www.blackdown.org
1212

13+
For problems with this driver, then refer to the postgres-interfaces email
14+
list:
15+
16+
http://www.postgresql.org
17+
18+
By the time V6.3 is released, full documentation will be on the web, and in
19+
the distribution.
20+
1321
---------------------------------------------------------------------------
1422

1523
COMPILING
@@ -115,15 +123,21 @@ them to the URL. eg:
115123
By default, the driver doesn't use password authentication. You can enable
116124
this by adding the argument auth. ie:
117125

118-
jdbc:postgresql:database?user=me&password=mypass&auth=y
126+
jdbc:postgresql:database?user=me&password=mypass&auth=password
119127

120128
or if passing the user & password directly via DriverManager.getConnection():
121129

122-
jdbc:postgresql:database?auth=y
130+
jdbc:postgresql:database?auth=password
123131

124-
PS: Password authentication is enabled if the value of auth starts with 'y'.
132+
PS: Password authentication is enabled if the value of auth starts with 'p'.
125133
It is case insensitive.
126134

135+
As of postgresql 6.3, Ident (RFC 1413) authentication is also supported.
136+
Simply use auth=ident in the url.
137+
138+
Also, as of 6.3, a system property of postgresql.auth is supported. This
139+
defines the default authentication to use. The auth property overides this.
140+
127141
---------------------------------------------------------------------------
128142

129143
That's the basics related to this driver. You'll need to read the JDBC Docs
@@ -180,7 +194,7 @@ syntax for writing these to the database.
180194

181195
---------------------------------------------------------------------------
182196

183-
Peter T Mount, October 28 1997
197+
Peter T Mount, January 11 1998
184198
home email: pmount@maidast.demon.co.uk http://www.demon.co.uk/finder
185199
work email: peter@maidstone.gov.uk http://www.maidstone.gov.uk
186200

src/interfaces/jdbc/README_6.3

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
Ok, here's the JDBC patch.
2+
3+
The jdbc6.3.tar.gz file that I've uploaded ftp.postgresql.org contains the
4+
following files:
5+
6+
README_6.3 This message
7+
blob.patch The patch to src/backend/tcop/fastpath.c fixing large objects
8+
jdbc.tar The entire jdbc driver
9+
10+
I've put the entire driver here, rather than a patch, because its become
11+
too complicated to do one this time. Files have been moved, two files
12+
removed because they were obsolete, and there are a lot of new files.
13+
14+
Heres what the patch does:
15+
16+
* Memory overflow problem in the backend causing large objects to fail in
17+
both libpq & jdbc (causing the backend to crash with a Segmentation
18+
Violation)
19+
* Problem with equals() method on the geometric support classes if the
20+
class being checked wasn't the same class
21+
* Fixed output of PGpath and PGpolygon support classes (missing , separator)
22+
* Optimised the geometric support classes
23+
* HTMLised the inline documentation, so the output of javadoc is easier
24+
to read (mainly paragraphs)
25+
* Removed obsolete class PGlobj (it never worked, and has been replaced
26+
to read (mainly paragraphs)
27+
* Removed obsolete class PGlobj (it never worked, and has been replaced
28+
by the postgresql.largeobject package)
29+
* Removed obsolete example JDBC_Test.java (replaced by new examples)
30+
* Added < and > to nesting in PGtokenizer.
31+
* Added fastpath support as a new package
32+
* Added large object support as a new package
33+
* Added ability of user code to handle custom storage types.
34+
* Added new example testing the importing and exporting of a large object
35+
* Added example application showing how to store and display images stored
36+
as large objects
37+
* Added example implementing part of psql client. This shows how to find out
38+
what tables/columns are in a database (not yet complete)
39+
* ResultSet.getBytes() now returns large object if field is an oid
40+
* ResultSet.getString() now doesn't call getBytes() as this now would
41+
cause an infinite loop because of large object support in getBytes()
42+
* PreparedStatement.setBytes() now create a large object, and store its
43+
oid into the column
44+
* Reworked date style handling to make it easier to support new styles
45+
* Added german and ISO styles, now all styles supported by postgresql
46+
are now supported by the driver
47+
* Fixed DatabaseMetaData.getTables()
48+
* DatabaseMetaData.getTableTypes() returns our supported types.
49+
* Fixed DatabaseMetaData.getColumns()
50+
51+
These three are required for Borland's JBuilder to work. For now they
52+
return an empty result, as I'm not sure yet on how to get the
53+
required results.
54+
* DatabaseMetaData.getBestRowIdentifier()
55+
* DatabaseMetaData.getProcedureColumns()
56+
* DatabaseMetaData.getIndexInfo()
57+
58+
Finally, one change that is incompatible with earlier versions of the
59+
driver. This change only affects any client code that uses the geometric
60+
classes (eg: PGpoint) or the getObject()/setObject() methods.
61+
62+
Because of a problem with javac, if user code includes the line:
63+
64+
import postgresql.*;
65+
66+
then javac will fail, saying that interfaces cannot be instanciated.
67+
68+
To fix this, I've moved these classes into a new sub package,
69+
postgresql.geometric and the PG_Object (renamed PGobject), and PGtokenizer
70+
to postgresql.util.So the above line would become:
71+
72+
import postgresql.geometric.*;
73+
74+
Anyhow, I'm going to start writing some proper documentation for the
75+
driver. For now, there is some available temporarily at:
76+
77+
http://www.demon.co.uk/finder/postgres/jdbc/packages.html
78+

0 commit comments

Comments
 (0)