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

Commit40c4416

Browse files
author
Barry Lind
committed
Fouth (and final) phase of restructuring to add jdbc3 support.
Modified Files: jdbc/org/postgresql/Driver.java.in jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java jdbc/org/postgresql/jdbc1/Jdbc1Connection.java jdbc/org/postgresql/jdbc1/Jdbc1ResultSet.java jdbc/org/postgresql/jdbc2/Jdbc2Connection.java jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java Added Files: jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSetMetaData.java jdbc/org/postgresql/jdbc1/Jdbc1DatabaseMetaData.java jdbc/org/postgresql/jdbc1/Jdbc1ResultSetMetaData.java jdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java jdbc/org/postgresql/jdbc2/Jdbc2DatabaseMetaData.java jdbc/org/postgresql/jdbc2/Jdbc2ResultSetMetaData.java Removed Files: jdbc/org/postgresql/jdbc1/DatabaseMetaData.java jdbc/org/postgresql/jdbc1/ResultSetMetaData.java jdbc/org/postgresql/jdbc2/DatabaseMetaData.java jdbc/org/postgresql/jdbc2/ResultSetMetaData.java
1 parent68c6eff commit40c4416

14 files changed

+114
-154
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,6 @@ public class Driver implements java.sql.Driver
442442
}
443443

444444
//The build number should be incremented for every new build
445-
private static int m_buildNumber =102;
445+
private static int m_buildNumber =103;
446446

447447
}

‎src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
importorg.postgresql.util.*;
1414

1515

16-
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Connection.java,v 1.2 2002/07/25 22:45:27 barry Exp $
16+
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Connection.java,v 1.3 2002/07/26 05:29:34 barry Exp $
1717
* This class defines methods of the jdbc1 specification. This class is
1818
* extended by org.postgresql.jdbc2.AbstractJdbc2Connection which adds the jdbc2
1919
* methods. The real Connection class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Connection
@@ -78,6 +78,10 @@ public abstract class AbstractJdbc1Connection implements org.postgresql.PGConnec
7878
*/
7979
privateintisolationLevel =java.sql.Connection.TRANSACTION_READ_COMMITTED;
8080

81+
82+
publicabstractjava.sql.StatementcreateStatement()throwsSQLException;
83+
84+
8185
/*
8286
* This method actually opens the connection. It is called by Driver.
8387
*
@@ -361,6 +365,8 @@ public org.postgresql.Driver getDriver()
361365

362366
publicabstractjava.sql.ResultSetgetResultSet(Statementstatement,org.postgresql.Field[]fields,Vectortuples,Stringstatus,intupdateCount,longinsertOID,booleanbinaryCursor)throwsSQLException;
363367

368+
publicabstractjava.sql.ResultSetgetResultSet(Statementstatement,org.postgresql.Field[]fields,Vectortuples,Stringstatus,intupdateCount)throwsSQLException;
369+
364370
/*
365371
* This adds a warning to the warning chain.
366372
* @param msg message to add

‎src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.javarenamed to‎src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java

Lines changed: 20 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,23 @@
11
packageorg.postgresql.jdbc1;
22

3-
// IMPORTANT NOTE: This file implements the JDBC 1 version of the driver.
4-
// If you make any modifications to this file, you must make sure that the
5-
// changes are also made (if relevent) to the related JDBC 2 class in the
6-
// org.postgresql.jdbc2 package.
73

84
importjava.sql.*;
95
importjava.util.*;
106
importorg.postgresql.Field;
117
importorg.postgresql.util.PSQLException;
128

13-
/*
14-
* This class provides information about the database as a whole.
15-
*
16-
* $Id: DatabaseMetaData.java,v 1.49 2002/07/25 22:45:28 barry Exp $
17-
*
18-
* <p>Many of the methods here return lists of information in ResultSets. You
19-
* can use the normal ResultSet methods such as getString and getInt to
20-
* retrieve the data from these ResultSets. If a given form of metadata is
21-
* not available, these methods should throw a SQLException.
22-
*
23-
* <p>Some of these methods take arguments that are String patterns. These
24-
* arguments all have names such as fooPattern. Within a pattern String,
25-
* "%" means match any substring of 0 or more characters, and "_" means
26-
* match any one character. Only metadata entries matching the search
27-
* pattern are returned. if a search pattern argument is set to a null
28-
* ref, it means that argument's criteria should be dropped from the
29-
* search.
30-
*
31-
* <p>A SQLException will be throws if a driver does not support a meta
32-
* data method. In the case of methods that return a ResultSet, either
33-
* a ResultSet (which may be empty) is returned or a SQLException is
34-
* thrown.
35-
*
36-
* @see java.sql.DatabaseMetaData
37-
*/
38-
publicclassDatabaseMetaDataimplementsjava.sql.DatabaseMetaData
9+
publicabstractclassAbstractJdbc1DatabaseMetaData
3910
{
40-
Jdbc1Connectionconnection;// The connection association
11+
protectedAbstractJdbc1Connectionconnection;// The connection association
4112

4213
// These define various OID's. Hopefully they will stay constant.
43-
staticfinalintiVarcharOid =1043;// OID for varchar
44-
staticfinalintiBoolOid =16;// OID for bool
45-
staticfinalintiInt2Oid =21;// OID for int2
46-
staticfinalintiInt4Oid =23;// OID for int4
47-
staticfinalintVARHDRSZ =4;// length for int4
14+
protectedstaticfinalintiVarcharOid =1043;// OID for varchar
15+
protectedstaticfinalintiBoolOid =16;// OID for bool
16+
protectedstaticfinalintiInt2Oid =21;// OID for int2
17+
protectedstaticfinalintiInt4Oid =23;// OID for int4
18+
protectedstaticfinalintVARHDRSZ =4;// length for int4
4819

49-
publicDatabaseMetaData(Jdbc1Connectionconn)
20+
publicAbstractJdbc1DatabaseMetaData(AbstractJdbc1Connectionconn)
5021
{
5122
this.connection =conn;
5223
}
@@ -2340,13 +2311,13 @@ else if (proname.endsWith("_del"))
23402311
if (col > -1)
23412312
{
23422313
Stringrule =proname.substring(8,proname.length() -4);
2343-
intaction =importedKeyNoAction;
2314+
intaction =java.sql.DatabaseMetaData.importedKeyNoAction;
23442315
if ("cascade".equals(rule))
2345-
action =importedKeyCascade;
2316+
action =java.sql.DatabaseMetaData.importedKeyCascade;
23462317
elseif ("setnull".equals(rule))
2347-
action =importedKeySetNull;
2318+
action =java.sql.DatabaseMetaData.importedKeySetNull;
23482319
elseif ("setdefault".equals(rule))
2349-
action =importedKeySetDefault;
2320+
action =java.sql.DatabaseMetaData.importedKeySetDefault;
23502321
tuple[col] =Integer.toString(action).getBytes();
23512322

23522323
if (!foundRule)
@@ -2388,15 +2359,15 @@ else if ("setdefault".equals(rule))
23882359
tuple[12] =rs.getBytes(4);//PK_NAME
23892360

23902361
// DEFERRABILITY
2391-
intdeferrability =importedKeyNotDeferrable;
2362+
intdeferrability =java.sql.DatabaseMetaData.importedKeyNotDeferrable;
23922363
booleandeferrable =rs.getBoolean(5);
23932364
booleaninitiallyDeferred =rs.getBoolean(6);
23942365
if (deferrable)
23952366
{
23962367
if (initiallyDeferred)
2397-
deferrability =importedKeyInitiallyDeferred;
2368+
deferrability =java.sql.DatabaseMetaData.importedKeyInitiallyDeferred;
23982369
else
2399-
deferrability =importedKeyInitiallyImmediate;
2370+
deferrability =java.sql.DatabaseMetaData.importedKeyInitiallyImmediate;
24002371
}
24012372
tuple[13] =Integer.toString(deferrability).getBytes();
24022373

@@ -2669,8 +2640,8 @@ public java.sql.ResultSet getTypeInfo() throws SQLException
26692640
byteb9[] ="9".getBytes();
26702641
byteb10[] ="10".getBytes();
26712642
bytebf[] ="f".getBytes();
2672-
bytebnn[] =Integer.toString(typeNoNulls).getBytes();
2673-
bytebts[] =Integer.toString(typeSearchable).getBytes();
2643+
bytebnn[] =Integer.toString(java.sql.DatabaseMetaData.typeNoNulls).getBytes();
2644+
bytebts[] =Integer.toString(java.sql.DatabaseMetaData.typeSearchable).getBytes();
26742645

26752646
while (rs.next())
26762647
{
@@ -2811,10 +2782,10 @@ public java.sql.ResultSet getIndexInfo(String catalog, String schema, String tab
28112782
tuple[4] =null;
28122783
tuple[5] =r.getBytes(3);
28132784
tuple[6] =r.getBoolean(4) ?
2814-
Integer.toString(tableIndexClustered).getBytes() :
2785+
Integer.toString(java.sql.DatabaseMetaData.tableIndexClustered).getBytes() :
28152786
r.getString(5).equals("hash") ?
2816-
Integer.toString(tableIndexHashed).getBytes() :
2817-
Integer.toString(tableIndexOther).getBytes();
2787+
Integer.toString(java.sql.DatabaseMetaData.tableIndexHashed).getBytes() :
2788+
Integer.toString(java.sql.DatabaseMetaData.tableIndexOther).getBytes();
28182789
tuple[7] =Integer.toString(i +1).getBytes();
28192790
if (columnNameRS.next())
28202791
{

‎src/interfaces/jdbc/org/postgresql/jdbc1/ResultSetMetaData.javarenamed to‎src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSetMetaData.java

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,17 @@
11
packageorg.postgresql.jdbc1;
22

3-
// IMPORTANT NOTE: This file implements the JDBC 1 version of the driver.
4-
// If you make any modifications to this file, you must make sure that the
5-
// changes are also made (if relevent) to the related JDBC 2 class in the
6-
// org.postgresql.jdbc2 package.
73

84
importjava.lang.*;
95
importjava.util.*;
106
importorg.postgresql.*;
117
importorg.postgresql.util.*;
12-
13-
// We explicitly import classes here as the original line:
14-
//import java.sql.*;
15-
// causes javac to get confused.
168
importjava.sql.SQLException;
179
importjava.sql.Types;
1810

19-
/*
20-
* A ResultSetMetaData object can be used to find out about the types and
21-
* properties of the columns in a ResultSet
22-
*
23-
* @see java.sql.ResultSetMetaData
24-
*/
25-
publicclassResultSetMetaDataimplementsjava.sql.ResultSetMetaData
11+
publicabstractclassAbstractJdbc1ResultSetMetaData
2612
{
27-
Vectorrows;
28-
Field[]fields;
13+
protectedVectorrows;
14+
protectedField[]fields;
2915

3016
/*
3117
*Initialise for a result with a tuple set and
@@ -34,7 +20,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData
3420
* @param rows the Vector of rows returned by the ResultSet
3521
* @param fields the array of field descriptors
3622
*/
37-
publicResultSetMetaData(Vectorrows,Field[]fields)
23+
publicAbstractJdbc1ResultSetMetaData(Vectorrows,Field[]fields)
3824
{
3925
this.rows =rows;
4026
this.fields =fields;
@@ -149,7 +135,7 @@ public int isNullable(int column) throws SQLException
149135
* defined with NOT NULL or PRIMARY KEY, CHECK constraints, views,
150136
* functions etc.
151137
*/
152-
returncolumnNullableUnknown;
138+
returnjava.sql.ResultSetMetaData.columnNullableUnknown;
153139
}
154140

155141
/*

‎src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1Connection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
importorg.postgresql.Field;
77
importorg.postgresql.util.PSQLException;
88

9-
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/Jdbc1Connection.java,v 1.3 2002/07/25 22:45:28 barry Exp $
9+
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/Jdbc1Connection.java,v 1.4 2002/07/26 05:29:35 barry Exp $
1010
* This class implements the java.sql.Connection interface for JDBC1.
1111
* However most of the implementation is really done in
1212
* org.postgresql.jdbc1.AbstractJdbc1Connection
@@ -32,7 +32,7 @@ public java.sql.CallableStatement prepareCall(String sql) throws SQLException
3232
publicjava.sql.DatabaseMetaDatagetMetaData()throwsSQLException
3333
{
3434
if (metadata ==null)
35-
metadata =neworg.postgresql.jdbc1.DatabaseMetaData(this);
35+
metadata =neworg.postgresql.jdbc1.Jdbc1DatabaseMetaData(this);
3636
returnmetadata;
3737
}
3838

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
packageorg.postgresql.jdbc1;
2+
3+
4+
importjava.sql.*;
5+
importjava.util.*;
6+
importorg.postgresql.Field;
7+
importorg.postgresql.util.PSQLException;
8+
9+
publicclassJdbc1DatabaseMetaDataextendsAbstractJdbc1DatabaseMetaDataimplementsjava.sql.DatabaseMetaData
10+
{
11+
publicJdbc1DatabaseMetaData(Jdbc1Connectionconn)
12+
{
13+
super(conn);
14+
}
15+
16+
}

‎src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1ResultSet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
importjava.util.Vector;
66
importorg.postgresql.Field;
77

8-
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/Jdbc1ResultSet.java,v 1.2 2002/07/25 22:45:28 barry Exp $
8+
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/Jdbc1ResultSet.java,v 1.3 2002/07/26 05:29:35 barry Exp $
99
* This class implements the java.sql.ResultSet interface for JDBC1.
1010
* However most of the implementation is really done in
1111
* org.postgresql.jdbc1.AbstractJdbc1ResultSet
@@ -20,7 +20,7 @@ public Jdbc1ResultSet(Jdbc1Connection conn, Statement statement, Field[] fields,
2020

2121
publicjava.sql.ResultSetMetaDatagetMetaData()throwsSQLException
2222
{
23-
returnnewResultSetMetaData(rows,fields);
23+
returnnewJdbc1ResultSetMetaData(rows,fields);
2424
}
2525

2626
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
packageorg.postgresql.jdbc1;
2+
3+
publicclassJdbc1ResultSetMetaDataextendsAbstractJdbc1ResultSetMetaDataimplementsjava.sql.ResultSetMetaData
4+
{
5+
publicJdbc1ResultSetMetaData(java.util.Vectorrows,org.postgresql.Field[]fields)
6+
{
7+
super(rows,fields);
8+
}
9+
10+
}
11+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp