Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6ee060f

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 parent2e6887d commit6ee060f

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
packageorg.postgresql;
217

318
importjava.sql.*;
@@ -7,75 +22,46 @@
722
importorg.postgresql.fastpath.Fastpath;
823
importorg.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
publicinterfacePGConnection
1626
{
17-
/*
18-
* Get the character encoding to use for this connection.
19-
*/
20-
publicEncodinggetEncoding()throwsSQLException;
21-
22-
/*
23-
* This method returns the java.sql.Types type for a postgres datatype name
24-
*/
25-
publicintgetSQLType(StringpgTypeName)throwsSQLException;
26-
27-
/*
28-
* This returns the java.sql.Types type for a postgres datatype OID
29-
*/
30-
publicintgetSQLType(intoid)throwsSQLException;
31-
32-
/*
33-
* This returns the postgres datatype name from the
34-
* postgres datatype OID
35-
*/
36-
publicStringgetPGType(intoid)throwsSQLException;
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-
publicintgetPGType(StringtypeName)throwsSQLException;
33+
publicPGNotification[]getNotifications();
4334

44-
/*
35+
/**
4536
* This returns the LargeObject API for the current connection.
37+
* @since 7.3
4638
*/
4739
publicLargeObjectManagergetLargeObjectAPI()throwsSQLException;
4840

49-
/*
41+
/**
5042
* This returns the Fastpath API for the current connection.
43+
* @since 7.3
5144
*/
5245
publicFastpathgetFastpathAPI()throwsSQLException;
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-
publicObjectgetObject(Stringtype,Stringvalue)throwsSQLException;
7047

48+
/** @deprecated */
49+
publicEncodinggetEncoding()throwsSQLException;
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-
publicPGNotification[]getNotifications();
51+
/** @deprecated */
52+
publicintgetSQLType(StringpgTypeName)throwsSQLException;
53+
54+
/** @deprecated */
55+
publicintgetSQLType(intoid)throwsSQLException;
56+
57+
/** @deprecated */
58+
publicStringgetPGType(intoid)throwsSQLException;
59+
60+
/** @deprecated */
61+
publicintgetPGType(StringtypeName)throwsSQLException;
7862

63+
/** @deprecated */
64+
publicObjectgetObject(Stringtype,Stringvalue)throwsSQLException;
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
packageorg.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
publicinterfacePGNotification
817
{
9-
/*
18+
/**
1019
* Returns name of this notification
20+
* @since 7.3
1121
*/
1222
publicStringgetName();
1323

14-
/*
24+
/**
1525
* Returns the process id of the backend process making this notification
26+
* @since 7.3
1627
*/
1728
publicintgetPID();
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
packageorg.postgresql;
216

317

418
importjava.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
publicinterfacePGStatement
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
publiclonggetLastOID()throwsSQLException;
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
publicvoidsetUseServerPrepare(booleanflag)throwsSQLException;
2236

37+
/**
38+
* Is this statement using server side prepared statements
39+
* @since 7.3
40+
*/
2341
publicbooleanisUseServerPrepare();
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+
packageorg.postgresql.core;
14+
15+
importjava.sql.DatabaseMetaData;
16+
importjava.sql.ResultSet;
17+
importjava.sql.Statement;
18+
importjava.sql.SQLException;
19+
importorg.postgresql.PGConnection;
20+
importorg.postgresql.PGNotification;
21+
22+
publicinterfaceBaseConnectionextendsPGConnection
23+
{
24+
25+
publicvoidaddNotification(PGNotificationp_notification);
26+
publicvoidaddWarning(Stringmsg);
27+
publicvoidcancelQuery()throwsSQLException;
28+
publicStatementcreateStatement()throwsSQLException;
29+
publicBaseResultSetexecSQL(Strings)throwsSQLException;
30+
publicStringgetCursorName()throwsSQLException;
31+
publicEncodinggetEncoding()throwsSQLException;
32+
publicDatabaseMetaDatagetMetaData()throwsSQLException;
33+
publicObjectgetObject(Stringtype,Stringvalue)throwsSQLException;
34+
publicPGStreamgetPGStream();
35+
publicStringgetPGType(intoid)throwsSQLException;
36+
publicintgetPGType(StringpgTypeName)throwsSQLException;
37+
publicintgetSQLType(intoid)throwsSQLException;
38+
publicintgetSQLType(StringpgTypeName)throwsSQLException;
39+
publicbooleanhaveMinimumCompatibleVersion(Stringver)throwsSQLException;
40+
publicbooleanhaveMinimumServerVersion(Stringver)throwsSQLException;
41+
publicvoidsetCursorName(Stringcursor)throwsSQLException;
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+
packageorg.postgresql.core;
14+
15+
16+
importjava.sql.ResultSet;
17+
importjava.sql.ResultSetMetaData;
18+
importjava.sql.SQLException;
19+
importjava.util.Vector;
20+
21+
publicinterfaceBaseResultSet
22+
{
23+
publicBaseStatementgetPGStatement();
24+
25+
publicvoidappend(BaseResultSetr);
26+
publicvoidclose()throwsSQLException;
27+
publicintgetColumnCount();
28+
publicStringgetCursorName()throwsSQLException;
29+
publicStringgetFixedString(intcol)throwsSQLException;
30+
publiclonggetLastOID();
31+
publicResultSetMetaDatagetMetaData()throwsSQLException;
32+
publicResultSetgetNext();
33+
publicObjectgetObject(intcolumnIndex)throwsSQLException;
34+
publicintgetResultCount();
35+
publicStringgetStatusString();
36+
publicStringgetString(intcolumnIndex)throwsSQLException;
37+
publicStringBuffergetStringBuffer();
38+
publicintgetTupleCount();
39+
publicbooleannext()throwsSQLException;
40+
publicbooleanreallyResultSet();
41+
publicvoidreInit (Field[]fields,Vectortuples,Stringstatus,
42+
intupdateCount,longinsertOID,booleanbinaryCursor);
43+
publicvoidsetStatement(BaseStatementstatement);
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+
packageorg.postgresql.core;
14+
15+
16+
importjava.sql.*;
17+
importjava.util.Vector;
18+
19+
publicinterfaceBaseStatementextendsorg.postgresql.PGStatement
20+
{
21+
publicBaseResultSetcreateResultSet(Field[]fields,Vectortuples,Stringstatus,intupdateCount,longinsertOID,booleanbinaryCursor)throwsSQLException;
22+
23+
publicBaseConnectiongetPGConnection();
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+
publicintgetFetchSize()throwsSQLException;
31+
publicintgetMaxRows()throwsSQLException;
32+
publicintgetResultSetConcurrency()throwsSQLException;
33+
publicStringgetStatementName();
34+
35+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp