mirror of
https://github.com/postgres/postgres.git
synced 2025-08-25 20:23:07 +03:00
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
This commit is contained in:
@@ -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.
|
||||
*
|
||||
* <p>This is a means of executing functions imbeded in the org.postgresql backend
|
||||
* from within a java application.
|
||||
* <p>This is a means of executing functions imbeded in the org.postgresql
|
||||
* backend from within a java application.
|
||||
*
|
||||
* <p>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
|
||||
*
|
||||
* <p><b>Important Notice</b>
|
||||
* <br>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.
|
||||
*
|
||||
* <p>The org.postgresql.LargeObject class performs a query upon it's startup,
|
||||
* <p>The org.postgresql.largeobject.LargeObject class performs a query upon it's startup,
|
||||
* and passes the returned ResultSet to the addFunctions() method here.
|
||||
*
|
||||
* <p>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
|
||||
{
|
||||
|
Reference in New Issue
Block a user