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

Commitf3148be

Browse files
committed
JDBC indenting, comment cleanups.
1 parent8f6f169 commitf3148be

File tree

75 files changed

+1925
-1880
lines changed

Some content is hidden

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

75 files changed

+1925
-1880
lines changed

‎src/interfaces/jdbc/org/postgresql/Connection.java

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
importorg.postgresql.util.*;
1111
importorg.postgresql.core.*;
1212

13-
/**
14-
* $Id: Connection.java,v 1.35 2001/11/12 19:11:56 barry Exp $
13+
/*
14+
* $Id: Connection.java,v 1.36 2001/11/19 22:33:37 momjian Exp $
1515
*
1616
* This abstract class is used by org.postgresql.Driver to open either the JDBC1 or
1717
* JDBC2 versions of the Connection class.
@@ -30,7 +30,7 @@ public abstract class Connection
3030
privatebooleanPG_STATUS;
3131
privateStringcompatible;
3232

33-
/**
33+
/*
3434
*The encoding to use for this connection.
3535
*/
3636
privateEncodingencoding =Encoding.defaultEncoding();
@@ -63,7 +63,7 @@ public abstract class Connection
6363
privatestaticfinalintAUTH_REQ_KRB5 =2;
6464
privatestaticfinalintAUTH_REQ_PASSWORD =3;
6565
privatestaticfinalintAUTH_REQ_CRYPT =4;
66-
privatestaticfinalintAUTH_REQ_MD5 =5;
66+
privatestaticfinalintAUTH_REQ_MD5 =5;
6767

6868
// New for 6.3, salt value for crypt authorisation
6969
privateStringsalt;
@@ -76,7 +76,7 @@ public abstract class Connection
7676
// Now handle notices as warnings, so things like "show" now work
7777
publicSQLWarningfirstWarning =null;
7878

79-
/**
79+
/*
8080
* Cache of the current isolation level
8181
*/
8282
privateintisolationLevel =java.sql.Connection.TRANSACTION_READ_COMMITTED;
@@ -85,13 +85,13 @@ public abstract class Connection
8585
publicintpid;
8686
publicintckey;
8787

88-
/**
88+
/*
8989
* This is called by Class.forName() from within org.postgresql.Driver
9090
*/
9191
publicConnection()
9292
{}
9393

94-
/**
94+
/*
9595
* This method actually opens the connection. It is called by Driver.
9696
*
9797
* @param host the hostname of the database back end
@@ -115,7 +115,7 @@ protected void openConnection(String host, int port, Properties info, String dat
115115
this_url =url;
116116
PG_DATABASE =database;
117117
PG_USER =info.getProperty("user");
118-
PG_PASSWORD =info.getProperty("password","");
118+
PG_PASSWORD =info.getProperty("password","");
119119
PG_PORT =port;
120120
PG_HOST =host;
121121
PG_STATUS =CONNECTION_BAD;
@@ -335,7 +335,7 @@ protected void openConnection(String host, int port, Properties info, String dat
335335
// are common to all implementations (JDBC1 or 2), they are placed here.
336336
// This should make it easy to maintain the two specifications.
337337

338-
/**
338+
/*
339339
* This adds a warning to the warning chain.
340340
* @param msg message to add
341341
*/
@@ -355,17 +355,17 @@ public void addWarning(String msg)
355355
// technique again, we'll know where to place it.
356356
//
357357
// This is generated by the SQL "show datestyle"
358-
//if(msg.startsWith("NOTICE:") && msg.indexOf("DateStyle")>0) {
358+
//if(msg.startsWith("NOTICE:") && msg.indexOf("DateStyle")>0) {
359359
//// 13 is the length off "DateStyle is "
360360
//msg = msg.substring(msg.indexOf("DateStyle is ")+13);
361361
//
362362
//for(int i=0;i<dateStyles.length;i+=2)
363-
//if(msg.startsWith(dateStyles[i]))
363+
//if(msg.startsWith(dateStyles[i]))
364364
//currentDateStyle=i+1; // this is the index of the format
365365
//}
366366
}
367367

368-
/**
368+
/*
369369
* Send a query to the backend. Returns one of the ResultSet
370370
* objects.
371371
*
@@ -381,7 +381,7 @@ public java.sql.ResultSet ExecSQL(String sql) throws SQLException
381381
returnExecSQL(sql,null);
382382
}
383383

384-
/**
384+
/*
385385
* Send a query to the backend. Returns one of the ResultSet
386386
* objects.
387387
*
@@ -398,7 +398,7 @@ public java.sql.ResultSet ExecSQL(String sql, java.sql.Statement stat) throws SQ
398398
returnnewQueryExecutor(sql,stat,pg_stream,this).execute();
399399
}
400400

401-
/**
401+
/*
402402
* In SQL, a result table can be retrieved through a cursor that
403403
* is named. The current row of a result can be updated or deleted
404404
* using a positioned update/delete statement that references the
@@ -416,7 +416,7 @@ public void setCursorName(String cursor) throws SQLException
416416
this.cursor =cursor;
417417
}
418418

419-
/**
419+
/*
420420
* getCursorName gets the cursor name.
421421
*
422422
* @return the current cursor name
@@ -427,7 +427,7 @@ public String getCursorName() throws SQLException
427427
returncursor;
428428
}
429429

430-
/**
430+
/*
431431
* We are required to bring back certain information by
432432
* the DatabaseMetaData class.These functions do that.
433433
*
@@ -441,7 +441,7 @@ public String getURL() throws SQLException
441441
returnthis_url;
442442
}
443443

444-
/**
444+
/*
445445
* Method getUserName() brings back the User Name (again, we
446446
* saved it)
447447
*
@@ -453,15 +453,15 @@ public String getUserName() throws SQLException
453453
returnPG_USER;
454454
}
455455

456-
/**
456+
/*
457457
* Get the character encoding to use for this connection.
458458
*/
459459
publicEncodinggetEncoding()throwsSQLException
460460
{
461461
returnencoding;
462462
}
463463

464-
/**
464+
/*
465465
* This returns the Fastpath API for the current connection.
466466
*
467467
* <p><b>NOTE:</b> This is not part of JDBC, but allows access to
@@ -493,7 +493,7 @@ public Fastpath getFastpathAPI() throws SQLException
493493
// This holds a reference to the Fastpath API if already open
494494
privateFastpathfastpath =null;
495495

496-
/**
496+
/*
497497
* This returns the LargeObject API for the current connection.
498498
*
499499
* <p><b>NOTE:</b> This is not part of JDBC, but allows access to
@@ -522,7 +522,7 @@ public LargeObjectManager getLargeObjectAPI() throws SQLException
522522
// This holds a reference to the LargeObject API if already open
523523
privateLargeObjectManagerlargeobject =null;
524524

525-
/**
525+
/*
526526
* This method is used internally to return an object based around
527527
* org.postgresql's more unique data types.
528528
*
@@ -594,7 +594,7 @@ public Object getObject(String type, String value) throws SQLException
594594
returnnull;
595595
}
596596

597-
/**
597+
/*
598598
* This stores an object into the database.
599599
* @param o Object to store
600600
* @return OID of the new rectord
@@ -639,7 +639,7 @@ public int putObject(Object o) throws SQLException
639639
}
640640
}
641641

642-
/**
642+
/*
643643
* This allows client code to add a handler for one of org.postgresql's
644644
* more unique data types.
645645
*
@@ -693,13 +693,13 @@ private void initObjectTypes()
693693
// These are required by other common classes
694694
publicabstractjava.sql.StatementcreateStatement()throwsSQLException;
695695

696-
/**
696+
/*
697697
* This returns a resultset. It must be overridden, so that the correct
698698
* version (from jdbc1 or jdbc2) are returned.
699699
*/
700700
publicabstractjava.sql.ResultSetgetResultSet(org.postgresql.Connectionconn,java.sql.Statementstat,Field[]fields,Vectortuples,Stringstatus,intupdateCount,intinsertOID,booleanbinaryCursor)throwsSQLException;
701701

702-
/**
702+
/*
703703
* In some cases, it is desirable to immediately release a Connection's
704704
* database and JDBC resources instead of waiting for them to be
705705
* automatically released (cant think why off the top of my head)
@@ -726,7 +726,7 @@ public void close() throws SQLException
726726
}
727727
}
728728

729-
/**
729+
/*
730730
* A driver may convert the JDBC sql grammar into its system's
731731
* native SQL grammar prior to sending it; nativeSQL returns the
732732
* native form of the statement that the driver would have sent.
@@ -741,7 +741,7 @@ public String nativeSQL(String sql) throws SQLException
741741
returnsql;
742742
}
743743

744-
/**
744+
/*
745745
* The first warning reported by calls on this Connection is
746746
* returned.
747747
*
@@ -756,7 +756,7 @@ public SQLWarning getWarnings() throws SQLException
756756
returnfirstWarning;
757757
}
758758

759-
/**
759+
/*
760760
* After this call, getWarnings returns null until a new warning
761761
* is reported for this connection.
762762
*
@@ -768,7 +768,7 @@ public void clearWarnings() throws SQLException
768768
}
769769

770770

771-
/**
771+
/*
772772
* You can put a connection in read-only mode as a hunt to enable
773773
* database optimizations
774774
*
@@ -783,7 +783,7 @@ public void setReadOnly(boolean readOnly) throws SQLException
783783
this.readOnly =readOnly;
784784
}
785785

786-
/**
786+
/*
787787
* Tests to see if the connection is in Read Only Mode. Note that
788788
* we cannot really put the database in read only mode, but we pretend
789789
* we can by returning the value of the readOnly flag
@@ -796,7 +796,7 @@ public boolean isReadOnly() throws SQLException
796796
returnreadOnly;
797797
}
798798

799-
/**
799+
/*
800800
* If a connection is in auto-commit mode, than all its SQL
801801
* statements will be executed and committed as individual
802802
* transactions. Otherwise, its SQL statements are grouped
@@ -835,7 +835,7 @@ public void setAutoCommit(boolean autoCommit) throws SQLException
835835
this.autoCommit =autoCommit;
836836
}
837837

838-
/**
838+
/*
839839
* gets the current auto-commit state
840840
*
841841
* @return Current state of the auto-commit mode
@@ -847,7 +847,7 @@ public boolean getAutoCommit() throws SQLException
847847
returnthis.autoCommit;
848848
}
849849

850-
/**
850+
/*
851851
* The method commit() makes all changes made since the previous
852852
* commit/rollback permanent and releases any database locks currently
853853
* held by the Connection.This method should only be used when
@@ -873,7 +873,7 @@ public void commit() throws SQLException
873873
}
874874
}
875875

876-
/**
876+
/*
877877
* The method rollback() drops all changes made since the previous
878878
* commit/rollback and releases any database locks currently held by
879879
* the Connection.
@@ -897,7 +897,7 @@ public void rollback() throws SQLException
897897
}
898898
}
899899

900-
/**
900+
/*
901901
* Get this Connection's current transaction isolation mode.
902902
*
903903
* @return the current TRANSACTION_* mode value
@@ -925,7 +925,7 @@ else if (message.indexOf("SERIALIZABLE") != -1)
925925
returnjava.sql.Connection.TRANSACTION_READ_COMMITTED;
926926
}
927927

928-
/**
928+
/*
929929
* You can call this method to try to change the transaction
930930
* isolation level using one of the TRANSACTION_* values.
931931
*
@@ -972,7 +972,7 @@ public void setTransactionIsolation(int level) throws SQLException
972972
ExecSQL(isolationLevelSQL);
973973
}
974974

975-
/**
975+
/*
976976
* Helper method used by setTransactionIsolation(), commit(), rollback()
977977
* and setAutoCommit(). This returns the SQL string needed to
978978
* set the isolation level for a transaction. In 7.1 and later it
@@ -1007,7 +1007,7 @@ protected String getIsolationLevelSQL() throws SQLException
10071007
returnsb.toString();
10081008
}
10091009

1010-
/**
1010+
/*
10111011
* A sub-space of this Connection's database may be selected by
10121012
* setting a catalog name.If the driver does not support catalogs,
10131013
* it will silently ignore this request
@@ -1019,7 +1019,7 @@ public void setCatalog(String catalog) throws SQLException
10191019
//no-op
10201020
}
10211021

1022-
/**
1022+
/*
10231023
* Return the connections current catalog name, or null if no
10241024
* catalog name is set, or we dont support catalogs.
10251025
*
@@ -1031,7 +1031,7 @@ public String getCatalog() throws SQLException
10311031
returnPG_DATABASE;
10321032
}
10331033

1034-
/**
1034+
/*
10351035
* Overides finalize(). If called, it closes the connection.
10361036
*
10371037
* This was done at the request of Rachel Greenham
@@ -1051,7 +1051,7 @@ private static String extractVersionNumber(String fullVersionString)
10511051
returnversionParts.nextToken();/* "X.Y.Z" */
10521052
}
10531053

1054-
/**
1054+
/*
10551055
* Get server version number
10561056
*/
10571057
publicStringgetDBVersionNumber()
@@ -1064,7 +1064,7 @@ public boolean haveMinimumServerVersion(String ver) throws SQLException
10641064
return (getDBVersionNumber().compareTo(ver) >=0);
10651065
}
10661066

1067-
/**
1067+
/*
10681068
* This method returns true if the compatible level set in the connection
10691069
* (which can be passed into the connection or specified in the URL)
10701070
* is at least the value passed to this method. This is used to toggle
@@ -1082,7 +1082,7 @@ public boolean haveMinimumCompatibleVersion(String ver) throws SQLException
10821082
}
10831083

10841084

1085-
/**
1085+
/*
10861086
* This returns the java.sql.Types type for a PG type oid
10871087
*
10881088
* @param oid PostgreSQL type oid
@@ -1111,15 +1111,15 @@ public int getSQLType(int oid) throws SQLException
11111111
returnsqlType.intValue();
11121112
}
11131113

1114-
/**
1114+
/*
11151115
* This returns the java.sql.Types type for a PG type
11161116
*
11171117
* @param pgTypeName PostgreSQL type name
11181118
* @return the java.sql.Types type
11191119
*/
11201120
publicabstractintgetSQLType(StringpgTypeName);
11211121

1122-
/**
1122+
/*
11231123
* This returns the oid for a given PG data type
11241124
* @param typeName PostgreSQL type name
11251125
* @return PostgreSQL oid value for a field of this type
@@ -1150,7 +1150,7 @@ public int getOID(String typeName) throws SQLException
11501150
returnoid;
11511151
}
11521152

1153-
/**
1153+
/*
11541154
* We also need to get the PG type name as returned by the back end.
11551155
*
11561156
* @return the String representation of the type of this field

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp