diff --git a/src/interfaces/jdbc/postgresql/ChangeLog b/src/interfaces/jdbc/postgresql/ChangeLog deleted file mode 100644 index 1a43c1f819..0000000000 --- a/src/interfaces/jdbc/postgresql/ChangeLog +++ /dev/null @@ -1,78 +0,0 @@ -Modifications done since 6.3.2 was released and Sun Aug 30 11:33:06 BST 1998 - - - Fixed PreparedStatement.setObject as it didn't handle shorts - - ResultSet.getDate() now handles null dates (returns null ratrher - than a NullPointerException) - - ResultSetMetaData.getPrecision() new returns 0 for VARCHAR - - Field now caches the typename->oid in a Hashtable to speed things - up. It removes the need for some unnecessary queries to the backend. - - PreparedStatement.toString() now returns the SQL statement that it - will send to the backend. Before it did nothing. - - DatabaseMetaData.getTypeInfo() now does something. - - Connection now throws an exception if either of the user or password - properties are missing, as they are required for JDBC to work. - This occasionally occurs when the client uses the properties version - of getConnection(), and is a common question on the email lists. - -Sun Aug 30 11:33:06 BST 1998 - - - Created ChangeLog file, and entered stuff done since 6.3.2 and today - - Change version number to 6.4 in Driver.java - - Added fix to DatabaseMetaData.getTables() submitted by - Stefan Andreasen - - Added fix to DatabaseMetaData.getColumns() to handle patterns - submitted by Stefan Andreasen - - Set TcpNoDelay on the connection, as this gives us a 10x speed - improvement on FreeBSD (caused by a bug in their TCP Stack). They - should fix the bug before 6.4 is released, but will keep this - in here unless it causes more problems. - Submitted by Jason Venner - - Removed a duplicate definition of fieldCache - - Added a more meaningful message when the connection is refused. It - now says: - Connection refused. Check that the hostname and port is - correct, and that the postmaster is running with the -i flag, - which enables TCP/IP networking. - - Removed kludge in PreparedStatement.setDate() that acted as a - temporary fix to a bug in SimpleDateFormat, as it broke date - handling in JDK 1.1.6. - - Modified PG_Stream and Connection, so that outbound data is now - buffered. This should give us a speed improvement, and reduce the - ammount of network packets generated. - - Removed duplicate code and optimised PG_Stream. - - PG_Stream now returns a more meaningful message when the connection - is broken by the backend. It now returns: - The backend has broken the connection. Possibly the action you - have attempted has caused it to close. - - Removed obsolete code from Connection. - - The error message returned when the authentication scheme is unknown - has been extended. It now reads: - Authentication type ### not supported. Check that you have - configured the pg_hba.conf file to include the client's IP - address or Subnet, and is using a supported authentication - scheme. - - Connection.getMetaData() now caches the instance returned, so - multiple calls will return the same instance. - - Created a test application that tests the DatabaseMetaData and - ResultSetMetaData classes. - - Replaced getString(#).getBytes() with getBytes(#) which should speed - things up, and reduce memory useage. - - Optimised DatabaseMetaData.getProcedures(), and implemented patterns - - Fixed NullPointerExceptions thrown when a field is null (Internal - to the driver, not caused by results from the backend. - DatabaseMetaData.getProcedures() is an example of a method that - causes this): - - ResultSetMetaData.getColumnName() now returns field# where - # is the column name. - - ResultSet.getObject() fixed - - Fixed bug in psql example that was affected by null fields - - DatabaseMetaData.getTables() - - DatabaseMetaData.getPrimaryKeys() ran a query with an ambiguous field - fixed. - - getTypeInfo() optimised to increase speed and reduce memory useage - - ResultSetMetaData.isCurrency() optimised and is now smaller. - - Removed unnecessary code fromResultSetMetaData.getCatalogName() - and getSchemaName(). - - Created new class postgresql.util.PGmoney to map the money type - - Created new class postgresql.geometric.PGline to map the line type - \ No newline at end of file diff --git a/src/interfaces/jdbc/postgresql/PG_Object.java b/src/interfaces/jdbc/postgresql/PG_Object.java deleted file mode 100644 index 22c0c039c6..0000000000 --- a/src/interfaces/jdbc/postgresql/PG_Object.java +++ /dev/null @@ -1,145 +0,0 @@ -package postgresql; - -import java.lang.*; -import java.sql.*; -import java.util.*; -import postgresql.*; - -/** - * postgresql.PG_Object is a class used to describe unknown types - * An unknown type is any type that is unknown by JDBC Standards - * - * @version 1.0 15-APR-1997 - * @author Adrian Hall - */ -public class PG_Object -{ - public String type; - public String value; - - /** - * Constructor for the PostgreSQL generic object - * - * @param type a string describing the type of the object - * @param value a string representation of the value of the object - */ - public PG_Object(String type, String value) throws SQLException - { - this.type = type; - this.value = value; - } - - /** - * This returns true if the object is a 'box' - */ - public boolean isBox() - { - return type.equals("box"); - } - - /** - * This returns a PGbox object, or null if it's not - * @return PGbox - */ - public PGbox getBox() throws SQLException - { - if(isBox()) - return new PGbox(value); - return null; - } - - /** - * This returns true if the object is a 'point' - */ - public boolean isCircle() - { - return type.equals("circle"); - } - - /** - * This returns a PGcircle object, or null if it's not - * @return PGcircle - */ - public PGcircle getCircle() throws SQLException - { - if(isCircle()) - return new PGcircle(value); - return null; - } - - /** - * This returns true if the object is a 'lseg' (line segment) - */ - public boolean isLseg() - { - return type.equals("lseg"); - } - - /** - * This returns a PGlsegobject, or null if it's not - * @return PGlseg - */ - public PGlseg getLseg() throws SQLException - { - if(isLseg()) - return new PGlseg(value); - return null; - } - - /** - * This returns true if the object is a 'path' - */ - public boolean isPath() - { - return type.equals("path"); - } - - /** - * This returns a PGpath object, or null if it's not - * @return PGpath - */ - public PGpath getPath() throws SQLException - { - if(isPath()) - return new PGpath(value); - return null; - } - - /** - * This returns true if the object is a 'point' - */ - public boolean isPoint() - { - return type.equals("point"); - } - - /** - * This returns a PGpoint object, or null if it's not - * @return PGpoint object - */ - public PGpoint getPoint() throws SQLException - { - if(isPoint()) - return new PGpoint(value); - return null; - } - - /** - * This returns true if the object is a 'polygon' - */ - public boolean isPolygon() - { - return type.equals("polygon"); - } - - /** - * This returns a PGpolygon object, or null if it's not - * @return PGpolygon - */ - public PGpolygon getPolygon() throws SQLException - { - if(isPolygon()) - return new PGpolygon(value); - return null; - } -} diff --git a/src/interfaces/jdbc/postgresql/PGbox.java b/src/interfaces/jdbc/postgresql/PGbox.java deleted file mode 100644 index b8edc00846..0000000000 --- a/src/interfaces/jdbc/postgresql/PGbox.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @version 6.2 - * - * This implements a box consisting of two points - * - */ - -package postgresql; - -import java.io.*; -import java.sql.*; - -public class PGbox implements Serializable -{ - /** - * These are the two points. - */ - public PGpoint point[] = new PGpoint[2]; - - public PGbox(double x1,double y1,double x2,double y2) - { - this.point[0] = new PGpoint(x1,y1); - this.point[1] = new PGpoint(x2,y2); - } - - public PGbox(PGpoint p1,PGpoint p2) - { - this.point[0] = p1; - this.point[1] = p2; - } - - /** - * This constructor is used by the driver. - */ - public PGbox(String s) throws SQLException - { - PGtokenizer t = new PGtokenizer(s,','); - if(t.getSize() != 2) - throw new SQLException("conversion of box failed - "+s); - - point[0] = new PGpoint(t.getToken(0)); - point[1] = new PGpoint(t.getToken(1)); - } - - public boolean equals(Object obj) - { - PGbox p = (PGbox)obj; - return (p.point[0].equals(point[0]) && p.point[1].equals(point[1])) || - (p.point[0].equals(point[1]) && p.point[1].equals(point[0])); - } - - /** - * This returns the lseg in the syntax expected by postgresql - */ - public String toString() - { - return point[0].toString()+","+point[1].toString(); - } -} diff --git a/src/interfaces/jdbc/postgresql/PGcircle.java b/src/interfaces/jdbc/postgresql/PGcircle.java deleted file mode 100644 index 543a0a71c9..0000000000 --- a/src/interfaces/jdbc/postgresql/PGcircle.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * - * This implements a circle consisting of a point and a radius - * - */ - -package postgresql; - -import java.io.*; -import java.sql.*; - -public class PGcircle implements Serializable -{ - /** - * This is the centre point - */ - public PGpoint center; - - /** - * This is the radius - */ - double radius; - - public PGcircle(double x,double y,double r) - { - this.center = new PGpoint(x,y); - this.radius = r; - } - - public PGcircle(PGpoint c,double r) - { - this.center = c; - this.radius = r; - } - - public PGcircle(PGcircle c) - { - this.center = new PGpoint(c.center); - this.radius = c.radius; - } - - /** - * This constructor is used by the driver. - */ - public PGcircle(String s) throws SQLException - { - PGtokenizer t = new PGtokenizer(PGtokenizer.removeAngle(s),','); - if(t.getSize() != 2) - throw new SQLException("conversion of circle failed - "+s); - - try { - center = new PGpoint(t.getToken(0)); - radius = Double.valueOf(t.getToken(1)).doubleValue(); - } catch(NumberFormatException e) { - throw new SQLException("conversion of circle failed - "+s+" - +"+e.toString()); - } - } - - public boolean equals(Object obj) - { - PGcircle p = (PGcircle)obj; - return p.center.equals(center) && p.radius==radius; - } - - /** - * This returns the circle in the syntax expected by postgresql - */ - public String toString() - { - return "<"+center+","+radius+">"; - } -} diff --git a/src/interfaces/jdbc/postgresql/PGlseg.java b/src/interfaces/jdbc/postgresql/PGlseg.java deleted file mode 100644 index d073b46b20..0000000000 --- a/src/interfaces/jdbc/postgresql/PGlseg.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - * This implements a lseg (line segment) consisting of two points - * - */ - -package postgresql; - -import java.io.*; -import java.sql.*; - -public class PGlseg implements Serializable -{ - /** - * These are the two points. - */ - public PGpoint point[] = new PGpoint[2]; - - public PGlseg(double x1,double y1,double x2,double y2) - { - this.point[0] = new PGpoint(x1,y1); - this.point[1] = new PGpoint(x2,y2); - } - - public PGlseg(PGpoint p1,PGpoint p2) - { - this.point[0] = p1; - this.point[1] = p2; - } - - /** - * This constructor is used by the driver. - */ - public PGlseg(String s) throws SQLException - { - PGtokenizer t = new PGtokenizer(PGtokenizer.removeBox(s),','); - if(t.getSize() != 2) - throw new SQLException("conversion of lseg failed - "+s); - - point[0] = new PGpoint(t.getToken(0)); - point[1] = new PGpoint(t.getToken(1)); - } - - public boolean equals(Object obj) - { - PGlseg p = (PGlseg)obj; - return (p.point[0].equals(point[0]) && p.point[1].equals(point[1])) || - (p.point[0].equals(point[1]) && p.point[1].equals(point[0])); - } - - /** - * This returns the lseg in the syntax expected by postgresql - */ - public String toString() - { - return "["+point[0]+","+point[1]+"]"; - } -} diff --git a/src/interfaces/jdbc/postgresql/PGpath.java b/src/interfaces/jdbc/postgresql/PGpath.java deleted file mode 100644 index d87bbedbaa..0000000000 --- a/src/interfaces/jdbc/postgresql/PGpath.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * - * This implements a path (a multiple segmented line, which may be closed) - * - */ - -package postgresql; - -import java.io.*; -import java.sql.*; - -public class PGpath implements Serializable -{ - public int npoints; - public boolean open; - public PGpoint point[]; - - public PGpath(int num,PGpoint[] points,boolean open) - { - npoints = num; - this.point = points; - this.open = open; - } - - /** - * This constructor is used by the driver. - */ - public PGpath(String s) throws SQLException - { - // First test to see if were open - if(s.startsWith("[") && s.endsWith("]")) { - open = true; - s = PGtokenizer.removeBox(s); - } else if(s.startsWith("(") && s.endsWith(")")) { - open = false; - s = PGtokenizer.removePara(s); - } else - throw new SQLException("cannot tell if path is open or closed"); - - PGtokenizer t = new PGtokenizer(s,','); - npoints = t.getSize(); - point = new PGpoint[npoints]; - for(int p=0;p");} - public void removeAngle() {remove("<",">");} -}