From 6ee060f201c4434157fd5e726e9ecc7b0c14d1dd Mon Sep 17 00:00:00 2001 From: Barry Lind Date: Fri, 7 Mar 2003 18:39:46 +0000 Subject: Cleanup and reorganization. - Added a private api layer (org.postgresql.core.Base*) - Cleaned up public api (org.postgresql.PG*) - Added consistent headers and copywrite info - Removed deprecated Serialize functionality - Cleaned up imports - Moved some files to more appropriate locations Modified Files: jdbc/org/postgresql/Driver.java.in jdbc/org/postgresql/PGConnection.java jdbc/org/postgresql/PGNotification.java jdbc/org/postgresql/PGStatement.java jdbc/org/postgresql/core/Encoding.java jdbc/org/postgresql/core/Notification.java jdbc/org/postgresql/core/QueryExecutor.java jdbc/org/postgresql/core/StartupPacket.java jdbc/org/postgresql/fastpath/Fastpath.java jdbc/org/postgresql/fastpath/FastpathArg.java jdbc/org/postgresql/geometric/PGbox.java jdbc/org/postgresql/geometric/PGcircle.java jdbc/org/postgresql/geometric/PGline.java jdbc/org/postgresql/geometric/PGlseg.java jdbc/org/postgresql/geometric/PGpath.java jdbc/org/postgresql/geometric/PGpoint.java jdbc/org/postgresql/geometric/PGpolygon.java jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSetMetaData.java jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java jdbc/org/postgresql/jdbc1/Jdbc1CallableStatement.java jdbc/org/postgresql/jdbc1/Jdbc1Connection.java jdbc/org/postgresql/jdbc1/Jdbc1DatabaseMetaData.java jdbc/org/postgresql/jdbc1/Jdbc1PreparedStatement.java jdbc/org/postgresql/jdbc1/Jdbc1ResultSet.java jdbc/org/postgresql/jdbc1/Jdbc1ResultSetMetaData.java jdbc/org/postgresql/jdbc1/Jdbc1Statement.java jdbc/org/postgresql/jdbc2/AbstractJdbc2Blob.java jdbc/org/postgresql/jdbc2/AbstractJdbc2Clob.java jdbc/org/postgresql/jdbc2/AbstractJdbc2Connection.java jdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java jdbc/org/postgresql/jdbc2/Array.java jdbc/org/postgresql/jdbc2/Jdbc2CallableStatement.java jdbc/org/postgresql/jdbc2/Jdbc2Connection.java jdbc/org/postgresql/jdbc2/Jdbc2PreparedStatement.java jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java jdbc/org/postgresql/jdbc2/Jdbc2ResultSetMetaData.java jdbc/org/postgresql/jdbc2/Jdbc2Statement.java jdbc/org/postgresql/jdbc3/AbstractJdbc3ResultSet.java jdbc/org/postgresql/jdbc3/Jdbc3CallableStatement.java jdbc/org/postgresql/jdbc3/Jdbc3Connection.java jdbc/org/postgresql/jdbc3/Jdbc3PreparedStatement.java jdbc/org/postgresql/jdbc3/Jdbc3ResultSet.java jdbc/org/postgresql/jdbc3/Jdbc3ResultSetMetaData.java jdbc/org/postgresql/jdbc3/Jdbc3Statement.java jdbc/org/postgresql/largeobject/BlobInputStream.java jdbc/org/postgresql/largeobject/BlobOutputStream.java jdbc/org/postgresql/largeobject/LargeObject.java jdbc/org/postgresql/largeobject/LargeObjectManager.java jdbc/org/postgresql/test/jdbc2/Jdbc2TestSuite.java jdbc/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java jdbc/org/postgresql/util/MD5Digest.java jdbc/org/postgresql/util/MessageTranslator.java jdbc/org/postgresql/util/PGbytea.java jdbc/org/postgresql/util/PGmoney.java jdbc/org/postgresql/util/PGobject.java jdbc/org/postgresql/util/PGtokenizer.java jdbc/org/postgresql/util/PSQLException.java jdbc/org/postgresql/util/UnixCrypt.java Added Files: jdbc/org/postgresql/core/BaseConnection.java jdbc/org/postgresql/core/BaseResultSet.java jdbc/org/postgresql/core/BaseStatement.java jdbc/org/postgresql/core/Field.java jdbc/org/postgresql/core/PGStream.java Removed Files: jdbc/org/postgresql/Field.java jdbc/org/postgresql/PG_Stream.java jdbc/org/postgresql/test/jdbc2/SerializeObject.java jdbc/org/postgresql/test/jdbc2/SerializeTest.java jdbc/org/postgresql/util/Serialize.java --- .../jdbc/org/postgresql/fastpath/Fastpath.java | 56 ++++++++++++---------- .../jdbc/org/postgresql/fastpath/FastpathArg.java | 33 ++++++------- 2 files changed, 44 insertions(+), 45 deletions(-) (limited to 'src/interfaces/jdbc/org/postgresql/fastpath') diff --git a/src/interfaces/jdbc/org/postgresql/fastpath/Fastpath.java b/src/interfaces/jdbc/org/postgresql/fastpath/Fastpath.java index 56676a40eca..1e094e15cf7 100644 --- a/src/interfaces/jdbc/org/postgresql/fastpath/Fastpath.java +++ b/src/interfaces/jdbc/org/postgresql/fastpath/Fastpath.java @@ -1,26 +1,34 @@ +/*------------------------------------------------------------------------- + * + * Fastpath.java + * This class implements the Fastpath api. + * + * Copyright (c) 2003, PostgreSQL Global Development Group + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/fastpath/Attic/Fastpath.java,v 1.12 2003/03/07 18:39:42 barry Exp $ + * + *------------------------------------------------------------------------- + */ package org.postgresql.fastpath; +import java.io.IOException; +import java.sql.SQLException; +import java.sql.ResultSet; +import java.util.Hashtable; import org.postgresql.Driver; -import java.io.*; -import java.lang.*; -import java.net.*; -import java.util.*; -import java.sql.*; -import org.postgresql.util.*; - -// Important: There are a lot of debug code commented out. Please do not -// delete these. +import org.postgresql.core.BaseConnection; +import org.postgresql.core.PGStream; +import org.postgresql.util.PSQLException; /* * This class implements the Fastpath api. * - *

This is a means of executing functions imbeded in the org.postgresql backend - * from within a java application. + *

This is a means of executing functions imbeded in the org.postgresql + * backend from within a java application. * *

It is based around the file src/interfaces/libpq/fe-exec.c * - * @see org.postgresql.FastpathFastpathArg - * @see org.postgresql.LargeObject */ public class Fastpath { @@ -28,20 +36,16 @@ public class Fastpath // to a connection). protected Hashtable func = new Hashtable(); - protected org.postgresql.PGConnection conn; // our connection - protected org.postgresql.PG_Stream stream; // the network stream + protected BaseConnection conn; // our connection + protected PGStream stream; // the network stream /* * Initialises the fastpath system * - *

Important Notice - *
This is called from org.postgresql.Connection, and should not be called - * from client code. - * - * @param conn org.postgresql.Connection to attach to + * @param conn BaseConnection to attach to * @param stream The network stream to the backend */ - public Fastpath(org.postgresql.PGConnection conn, org.postgresql.PG_Stream stream) + public Fastpath(BaseConnection conn, PGStream stream) { this.conn = conn; this.stream = stream; @@ -113,7 +117,7 @@ public class Fastpath //------------------------------ // Notice from backend case 'N': - ((org.postgresql.jdbc1.AbstractJdbc1Connection)conn).addWarning(stream.ReceiveString(conn.getEncoding())); + conn.addWarning(stream.ReceiveString(conn.getEncoding())); break; case 'V': @@ -164,7 +168,7 @@ public class Fastpath * This is the prefered method to call, as function id's can/may change * between versions of the backend. * - * For an example of how this works, refer to org.postgresql.LargeObject + * For an example of how this works, refer to org.postgresql.largeobject.LargeObject * * @param name Function name * @param resulttype True if the result is an integer, false for other @@ -173,7 +177,7 @@ public class Fastpath * @return null if no data, Integer if an integer result, or byte[] otherwise * @exception SQLException if name is unknown or if a database-access error * occurs. - * @see org.postgresql.LargeObject + * @see org.postgresql.largeobject.LargeObject */ public Object fastpath(String name, boolean resulttype, FastpathArg[] args) throws SQLException { @@ -242,7 +246,7 @@ public class Fastpath * the function's required are entered into this table, keeping connection * times as fast as possible. * - *

The org.postgresql.LargeObject class performs a query upon it's startup, + *

The org.postgresql.largeobject.LargeObject class performs a query upon it's startup, * and passes the returned ResultSet to the addFunctions() method here. * *

Once this has been done, the LargeObject api refers to the functions by @@ -255,7 +259,7 @@ public class Fastpath * * @param rs ResultSet * @exception SQLException if a database-access error occurs. - * @see org.postgresql.LargeObjectManager + * @see org.postgresql.largeobject.LargeObjectManager */ public void addFunctions(ResultSet rs) throws SQLException { diff --git a/src/interfaces/jdbc/org/postgresql/fastpath/FastpathArg.java b/src/interfaces/jdbc/org/postgresql/fastpath/FastpathArg.java index 1539ee8a144..7e59ce2387d 100644 --- a/src/interfaces/jdbc/org/postgresql/fastpath/FastpathArg.java +++ b/src/interfaces/jdbc/org/postgresql/fastpath/FastpathArg.java @@ -1,25 +1,20 @@ -package org.postgresql.fastpath; - -import java.io.*; -import java.lang.*; -import java.net.*; -import java.util.*; -import java.sql.*; -import org.postgresql.util.*; - -/* - * Each fastpath call requires an array of arguments, the number and type - * dependent on the function being called. +/*------------------------------------------------------------------------- + * + * FastpathArg.java + * Each fastpath call requires an array of arguments, the number and type + * dependent on the function being called. * - *

This class implements methods needed to provide this capability. + * Copyright (c) 2003, PostgreSQL Global Development Group * - *

For an example on how to use this, refer to the org.postgresql.largeobject - * package + * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/fastpath/Attic/FastpathArg.java,v 1.4 2003/03/07 18:39:42 barry Exp $ * - * @see org.postgresql.fastpath.Fastpath - * @see org.postgresql.largeobject.LargeObjectManager - * @see org.postgresql.largeobject.LargeObject + *------------------------------------------------------------------------- */ +package org.postgresql.fastpath; + +import java.io.IOException; + public class FastpathArg { /* @@ -90,7 +85,7 @@ public class FastpathArg * @param s output stream * @exception IOException if something failed on the network stream */ - protected void send(org.postgresql.PG_Stream s) throws IOException + protected void send(org.postgresql.core.PGStream s) throws IOException { if (type) { -- cgit v1.2.3