Skip to content

Commit 6ee060f

Browse files
author
Barry Lind
committed
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
1 parent 2e6887d commit 6ee060f

File tree

72 files changed

+1122
-1519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1122
-1519
lines changed

src/interfaces/jdbc/org/postgresql/Driver.java.in

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* Driver.java(.in)
4+
* The Postgresql JDBC Driver implementation
5+
*
6+
* Copyright (c) 2003, PostgreSQL Global Development Group
7+
*
8+
* IDENTIFICATION
9+
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/Driver.java.in,v 1.27 2003/03/07 18:39:41 barry Exp $
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
113
package org.postgresql;
214

315
import java.io.*;
@@ -22,7 +34,7 @@ import org.postgresql.util.PSQLException;
2234
* and register it with the DriverManager. This means that a user can load
2335
* and register a driver by doing Class.forName("foo.bah.Driver")
2436
*
25-
* @see org.postgresql.Connection
37+
* @see org.postgresql.PGConnection
2638
* @see java.sql.Driver
2739
*/
2840
public class Driver implements java.sql.Driver
@@ -460,7 +472,7 @@ public class Driver implements java.sql.Driver
460472
}
461473

462474

463-
public static void makeSSL(PG_Stream p_stream) throws IOException {
475+
public static void makeSSL(org.postgresql.core.PGStream p_stream) throws IOException {
464476
@SSL@ if (logDebug)
465477
@SSL@ debug("converting regular socket connection to ssl");
466478
@SSL@ javax.net.ssl.SSLSocketFactory factory = (javax.net.ssl.SSLSocketFactory) javax.net.ssl.SSLSocketFactory.getDefault();
@@ -477,6 +489,6 @@ public class Driver implements java.sql.Driver
477489

478490

479491
//The build number should be incremented for every new build
480-
private static int m_buildNumber = 202;
492+
private static int m_buildNumber = 203;
481493

482494
}
Lines changed: 40 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* PGConnection.java
4+
* The public interface definition for a Postgresql Connection
5+
* This interface defines PostgreSQL extentions to the java.sql.Connection
6+
* interface. Any java.sql.Connection object returned by the driver will
7+
* also implement this interface
8+
*
9+
* Copyright (c) 2003, PostgreSQL Global Development Group
10+
*
11+
* IDENTIFICATION
12+
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/PGConnection.java,v 1.4 2003/03/07 18:39:41 barry Exp $
13+
*
14+
*-------------------------------------------------------------------------
15+
*/
116
package org.postgresql;
217

318
import java.sql.*;
@@ -7,75 +22,46 @@
722
import org.postgresql.fastpath.Fastpath;
823
import org.postgresql.largeobject.LargeObjectManager;
924

10-
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/PGConnection.java,v 1.3 2002/09/06 21:23:05 momjian Exp $
11-
* This interface defines PostgreSQL extentions to the java.sql.Connection interface.
12-
* Any java.sql.Connection object returned by the driver will also implement this
13-
* interface
14-
*/
1525
public interface PGConnection
1626
{
17-
/*
18-
* Get the character encoding to use for this connection.
19-
*/
20-
public Encoding getEncoding() throws SQLException;
21-
22-
/*
23-
* This method returns the java.sql.Types type for a postgres datatype name
24-
*/
25-
public int getSQLType(String pgTypeName) throws SQLException;
26-
27-
/*
28-
* This returns the java.sql.Types type for a postgres datatype OID
29-
*/
30-
public int getSQLType(int oid) throws SQLException;
31-
32-
/*
33-
* This returns the postgres datatype name from the
34-
* postgres datatype OID
35-
*/
36-
public String getPGType(int oid) throws SQLException;
37-
38-
/*
39-
* This returns the postgres datatype OID from the
40-
* postgres datatype name
27+
/**
28+
* This method returns any notifications that have been received
29+
* since the last call to this method.
30+
* Returns null if there have been no notifications.
31+
* @since 7.3
4132
*/
42-
public int getPGType(String typeName) throws SQLException;
33+
public PGNotification[] getNotifications();
4334

44-
/*
35+
/**
4536
* This returns the LargeObject API for the current connection.
37+
* @since 7.3
4638
*/
4739
public LargeObjectManager getLargeObjectAPI() throws SQLException;
4840

49-
/*
41+
/**
5042
* This returns the Fastpath API for the current connection.
43+
* @since 7.3
5144
*/
5245
public Fastpath getFastpathAPI() throws SQLException;
5346

54-
/*
55-
* This method is used internally to return an object based around
56-
* org.postgresql's more unique data types.
57-
*
58-
* <p>It uses an internal Hashtable to get the handling class. If the
59-
* type is not supported, then an instance of org.postgresql.util.PGobject
60-
* is returned.
61-
*
62-
* You can use the getValue() or setValue() methods to handle the returned
63-
* object. Custom objects can have their own methods.
64-
*
65-
* @return PGobject for this type, and set to value
66-
* @exception SQLException if value is not correct for this type
67-
* @see org.postgresql.util.Serialize
68-
*/
69-
public Object getObject(String type, String value) throws SQLException;
7047

48+
/** @deprecated */
49+
public Encoding getEncoding() throws SQLException;
7150

72-
/*
73-
* This method returns any notifications that have been received
74-
* since the last call to this method.
75-
* Returns null if there have been no notifications.
76-
*/
77-
public PGNotification[] getNotifications();
51+
/** @deprecated */
52+
public int getSQLType(String pgTypeName) throws SQLException;
53+
54+
/** @deprecated */
55+
public int getSQLType(int oid) throws SQLException;
56+
57+
/** @deprecated */
58+
public String getPGType(int oid) throws SQLException;
59+
60+
/** @deprecated */
61+
public int getPGType(String typeName) throws SQLException;
7862

63+
/** @deprecated */
64+
public Object getObject(String type, String value) throws SQLException;
7965

8066
}
8167

src/interfaces/jdbc/org/postgresql/PGNotification.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* PGNotification.java
4+
* This interface defines public PostgreSQL extention for Notifications
5+
*
6+
* Copyright (c) 2003, PostgreSQL Global Development Group
7+
*
8+
* IDENTIFICATION
9+
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/PGNotification.java,v 1.3 2003/03/07 18:39:41 barry Exp $
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
113
package org.postgresql;
214

315

4-
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/PGNotification.java,v 1.2 2002/09/06 21:23:05 momjian Exp $
5-
* This interface defines PostgreSQL extention for Notifications
6-
*/
716
public interface PGNotification
817
{
9-
/*
18+
/**
1019
* Returns name of this notification
20+
* @since 7.3
1121
*/
1222
public String getName();
1323

14-
/*
24+
/**
1525
* Returns the process id of the backend process making this notification
26+
* @since 7.3
1627
*/
1728
public int getPID();
1829

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,43 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* PGStatement.java
4+
* This interface defines PostgreSQL extentions to the java.sql.Statement
5+
* interface. Any java.sql.Statement object returned by the driver will
6+
* also implement this interface
7+
*
8+
* Copyright (c) 2003, PostgreSQL Global Development Group
9+
*
10+
* IDENTIFICATION
11+
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/PGStatement.java,v 1.7 2003/03/07 18:39:41 barry Exp $
12+
*
13+
*-------------------------------------------------------------------------
14+
*/
115
package org.postgresql;
216

317

418
import java.sql.*;
519

6-
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/PGStatement.java,v 1.6 2002/09/08 00:15:28 barry Exp $
7-
* This interface defines PostgreSQL extentions to the java.sql.Statement interface.
8-
* Any java.sql.Statement object returned by the driver will also implement this
9-
* interface
10-
*/
1120
public interface PGStatement
1221
{
1322

14-
/*
23+
/**
1524
* Returns the Last inserted/updated oid.
1625
* @return OID of last insert
17-
* @since 7.3
26+
* @since 7.3
1827
*/
1928
public long getLastOID() throws SQLException;
2029

30+
/**
31+
* Turn on the use of prepared statements in the server (server side
32+
* prepared statements are unrelated to jdbc PreparedStatements)
33+
* @since 7.3
34+
*/
2135
public void setUseServerPrepare(boolean flag) throws SQLException;
2236

37+
/**
38+
* Is this statement using server side prepared statements
39+
* @since 7.3
40+
*/
2341
public boolean isUseServerPrepare();
2442

2543
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* BaseConnection.java
4+
* The internal interface definition for a jdbc connection
5+
*
6+
* Copyright (c) 2003, PostgreSQL Global Development Group
7+
*
8+
* IDENTIFICATION
9+
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/core/Attic/BaseConnection.java,v 1.1 2003/03/07 18:39:41 barry Exp $
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
package org.postgresql.core;
14+
15+
import java.sql.DatabaseMetaData;
16+
import java.sql.ResultSet;
17+
import java.sql.Statement;
18+
import java.sql.SQLException;
19+
import org.postgresql.PGConnection;
20+
import org.postgresql.PGNotification;
21+
22+
public interface BaseConnection extends PGConnection
23+
{
24+
25+
public void addNotification(PGNotification p_notification);
26+
public void addWarning(String msg);
27+
public void cancelQuery() throws SQLException;
28+
public Statement createStatement() throws SQLException;
29+
public BaseResultSet execSQL(String s) throws SQLException;
30+
public String getCursorName() throws SQLException;
31+
public Encoding getEncoding() throws SQLException;
32+
public DatabaseMetaData getMetaData() throws SQLException;
33+
public Object getObject(String type, String value) throws SQLException;
34+
public PGStream getPGStream();
35+
public String getPGType(int oid) throws SQLException;
36+
public int getPGType(String pgTypeName) throws SQLException;
37+
public int getSQLType(int oid) throws SQLException;
38+
public int getSQLType(String pgTypeName) throws SQLException;
39+
public boolean haveMinimumCompatibleVersion(String ver) throws SQLException;
40+
public boolean haveMinimumServerVersion(String ver) throws SQLException;
41+
public void setCursorName(String cursor) throws SQLException;
42+
43+
}
44+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* BaseResultSet.java
4+
* The internal interface definition for a jdbc result set
5+
*
6+
* Copyright (c) 2003, PostgreSQL Global Development Group
7+
*
8+
* IDENTIFICATION
9+
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/core/Attic/BaseResultSet.java,v 1.1 2003/03/07 18:39:41 barry Exp $
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
package org.postgresql.core;
14+
15+
16+
import java.sql.ResultSet;
17+
import java.sql.ResultSetMetaData;
18+
import java.sql.SQLException;
19+
import java.util.Vector;
20+
21+
public interface BaseResultSet
22+
{
23+
public BaseStatement getPGStatement();
24+
25+
public void append(BaseResultSet r);
26+
public void close() throws SQLException;
27+
public int getColumnCount();
28+
public String getCursorName() throws SQLException;
29+
public String getFixedString(int col) throws SQLException;
30+
public long getLastOID();
31+
public ResultSetMetaData getMetaData() throws SQLException;
32+
public ResultSet getNext();
33+
public Object getObject(int columnIndex) throws SQLException;
34+
public int getResultCount();
35+
public String getStatusString();
36+
public String getString(int columnIndex) throws SQLException;
37+
public StringBuffer getStringBuffer();
38+
public int getTupleCount();
39+
public boolean next() throws SQLException;
40+
public boolean reallyResultSet();
41+
public void reInit (Field[] fields, Vector tuples, String status,
42+
int updateCount, long insertOID, boolean binaryCursor);
43+
public void setStatement(BaseStatement statement);
44+
45+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* BaseStatement.java
4+
* The internal interface definition for a jdbc statement
5+
*
6+
* Copyright (c) 2003, PostgreSQL Global Development Group
7+
*
8+
* IDENTIFICATION
9+
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/core/Attic/BaseStatement.java,v 1.1 2003/03/07 18:39:41 barry Exp $
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
package org.postgresql.core;
14+
15+
16+
import java.sql.*;
17+
import java.util.Vector;
18+
19+
public interface BaseStatement extends org.postgresql.PGStatement
20+
{
21+
public BaseResultSet createResultSet(Field[] fields, Vector tuples, String status, int updateCount, long insertOID, boolean binaryCursor) throws SQLException;
22+
23+
public BaseConnection getPGConnection();
24+
25+
/*
26+
* The maxRows limit is set to limit the number of rows that
27+
* any ResultSet can contain. If the limit is exceeded, the
28+
* excess rows are silently dropped.
29+
*/
30+
public int getFetchSize() throws SQLException;
31+
public int getMaxRows() throws SQLException;
32+
public int getResultSetConcurrency() throws SQLException;
33+
public String getStatementName();
34+
35+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy