Skip to content
Snippets Groups Projects
Commit 50f39b21 authored by Christoph Berg's avatar Christoph Berg :satellite:
Browse files

New upstream version 42.5.1

parent ac6a312b
No related branches found
No related tags found
No related merge requests found
Showing
with 110 additions and 90 deletions
...@@ -47,7 +47,7 @@ There are also available (snapshot) binary RPMs in [Fedora's Copr repository](ht ...@@ -47,7 +47,7 @@ There are also available (snapshot) binary RPMs in [Fedora's Copr repository](ht
---------------------------------------------------- ----------------------------------------------------
## Documentation ## Documentation
For more information you can read [the PgJDBC driver documentation](https://jdbc.postgresql.org/documentation/head/) or for general JDBC documentation please refer to [The Java™ Tutorials](http://docs.oracle.com/javase/tutorial/jdbc/). For more information you can read [the PgJDBC driver documentation](https://jdbc.postgresql.org/documentation/) or for general JDBC documentation please refer to [The Java™ Tutorials](http://docs.oracle.com/javase/tutorial/jdbc/).
### Driver and DataSource class ### Driver and DataSource class
......
# Default build parameters. These may be overridden by local configuration # Default build parameters. These may be overridden by local configuration
# settings in build.local.properties. # settings in build.local.properties.
# loggerLevel can be OFF, DEBUG, TRACE
# #
server=localhost server=localhost
...@@ -16,7 +15,5 @@ privilegedUser=postgres ...@@ -16,7 +15,5 @@ privilegedUser=postgres
privilegedPassword= privilegedPassword=
sspiusername=testsspi sspiusername=testsspi
preparethreshold=5 preparethreshold=5
loggerLevel=OFF
loggerFile=target/pgjdbc-tests.log
protocolVersion=0 protocolVersion=0
sslpassword=sslpwd sslpassword=sslpwd
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<artifactId>postgresql</artifactId> <artifactId>postgresql</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>PostgreSQL JDBC Driver - JDBC 4.2</name> <name>PostgreSQL JDBC Driver - JDBC 4.2</name>
<version>42.5.0</version> <version>42.5.1</version>
<description>Java JDBC 4.2 (JRE 8+) driver for PostgreSQL database</description> <description>Java JDBC 4.2 (JRE 8+) driver for PostgreSQL database</description>
<url>https://github.com/pgjdbc/pgjdbc</url> <url>https://github.com/pgjdbc/pgjdbc</url>
......
...@@ -8,11 +8,11 @@ package org.postgresql; ...@@ -8,11 +8,11 @@ package org.postgresql;
import static org.postgresql.util.internal.Nullness.castNonNull; import static org.postgresql.util.internal.Nullness.castNonNull;
import org.postgresql.jdbc.PgConnection; import org.postgresql.jdbc.PgConnection;
import org.postgresql.jdbcurlresolver.PgPassParser;
import org.postgresql.jdbcurlresolver.PgServiceConfParser;
import org.postgresql.util.DriverInfo; import org.postgresql.util.DriverInfo;
import org.postgresql.util.GT; import org.postgresql.util.GT;
import org.postgresql.util.HostSpec; import org.postgresql.util.HostSpec;
import org.postgresql.util.PGPropertyPasswordParser;
import org.postgresql.util.PGPropertyServiceParser;
import org.postgresql.util.PGPropertyUtil; import org.postgresql.util.PGPropertyUtil;
import org.postgresql.util.PSQLException; import org.postgresql.util.PSQLException;
import org.postgresql.util.PSQLState; import org.postgresql.util.PSQLState;
...@@ -629,7 +629,7 @@ public class Driver implements java.sql.Driver { ...@@ -629,7 +629,7 @@ public class Driver implements java.sql.Driver {
// load pg_service.conf // load pg_service.conf
if (serviceName != null) { if (serviceName != null) {
LOGGER.log(Level.FINE, "Processing option [?service={0}]", serviceName); LOGGER.log(Level.FINE, "Processing option [?service={0}]", serviceName);
Properties result = PGPropertyServiceParser.getServiceProperties(serviceName); Properties result = PgServiceConfParser.getServiceProperties(serviceName);
if (result == null) { if (result == null) {
LOGGER.log(Level.WARNING, "Definition of service [{0}] not found", serviceName); LOGGER.log(Level.WARNING, "Definition of service [{0}] not found", serviceName);
return null; return null;
...@@ -652,8 +652,8 @@ public class Driver implements java.sql.Driver { ...@@ -652,8 +652,8 @@ public class Driver implements java.sql.Driver {
// priority 5 - PGProperty defaults for PGHOST, PGPORT, PGDBNAME // priority 5 - PGProperty defaults for PGHOST, PGPORT, PGDBNAME
result.putIfAbsent(PGProperty.PG_PORT.getName(), castNonNull(PGProperty.PG_PORT.getDefaultValue())); result.putIfAbsent(PGProperty.PG_PORT.getName(), castNonNull(PGProperty.PG_PORT.getDefaultValue()));
result.putIfAbsent(PGProperty.PG_HOST.getName(), castNonNull(PGProperty.PG_HOST.getDefaultValue())); result.putIfAbsent(PGProperty.PG_HOST.getName(), castNonNull(PGProperty.PG_HOST.getDefaultValue()));
if (PGProperty.USER.get(result) != null) { if (PGProperty.USER.getOrDefault(result) != null) {
result.putIfAbsent(PGProperty.PG_DBNAME.getName(), castNonNull(PGProperty.USER.get(result))); result.putIfAbsent(PGProperty.PG_DBNAME.getName(), castNonNull(PGProperty.USER.getOrDefault(result)));
} }
// consistency check // consistency check
...@@ -662,9 +662,9 @@ public class Driver implements java.sql.Driver { ...@@ -662,9 +662,9 @@ public class Driver implements java.sql.Driver {
} }
// try to load .pgpass if password is missing // try to load .pgpass if password is missing
if (PGProperty.PASSWORD.get(result) == null) { if (PGProperty.PASSWORD.getOrDefault(result) == null) {
String password = PGPropertyPasswordParser.getPassword( String password = PgPassParser.getPassword(
PGProperty.PG_HOST.get(result), PGProperty.PG_PORT.get(result), PGProperty.PG_DBNAME.get(result), PGProperty.USER.get(result) PGProperty.PG_HOST.getOrDefault(result), PGProperty.PG_PORT.getOrDefault(result), PGProperty.PG_DBNAME.getOrDefault(result), PGProperty.USER.getOrDefault(result)
); );
if (password != null && !password.isEmpty()) { if (password != null && !password.isEmpty()) {
PGProperty.PASSWORD.set(result, password); PGProperty.PASSWORD.set(result, password);
...@@ -688,9 +688,9 @@ public class Driver implements java.sql.Driver { ...@@ -688,9 +688,9 @@ public class Driver implements java.sql.Driver {
* @return the address portion of the URL * @return the address portion of the URL
*/ */
private static HostSpec[] hostSpecs(Properties props) { private static HostSpec[] hostSpecs(Properties props) {
String[] hosts = castNonNull(PGProperty.PG_HOST.get(props)).split(","); String[] hosts = castNonNull(PGProperty.PG_HOST.getOrDefault(props)).split(",");
String[] ports = castNonNull(PGProperty.PG_PORT.get(props)).split(","); String[] ports = castNonNull(PGProperty.PG_PORT.getOrDefault(props)).split(",");
String localSocketAddress = PGProperty.LOCAL_SOCKET_ADDRESS.get(props); String localSocketAddress = PGProperty.LOCAL_SOCKET_ADDRESS.getOrDefault(props);
HostSpec[] hostSpecs = new HostSpec[hosts.length]; HostSpec[] hostSpecs = new HostSpec[hosts.length];
for (int i = 0; i < hostSpecs.length; ++i) { for (int i = 0; i < hostSpecs.length; ++i) {
hostSpecs[i] = new HostSpec(hosts[i], Integer.parseInt(ports[i]), localSocketAddress); hostSpecs[i] = new HostSpec(hosts[i], Integer.parseInt(ports[i]), localSocketAddress);
...@@ -702,7 +702,7 @@ public class Driver implements java.sql.Driver { ...@@ -702,7 +702,7 @@ public class Driver implements java.sql.Driver {
* @return the timeout from the URL, in milliseconds * @return the timeout from the URL, in milliseconds
*/ */
private static long timeout(Properties props) { private static long timeout(Properties props) {
String timeout = PGProperty.LOGIN_TIMEOUT.get(props); String timeout = PGProperty.LOGIN_TIMEOUT.getOrDefault(props);
if (timeout != null) { if (timeout != null) {
try { try {
return (long) (Float.parseFloat(timeout) * 1000); return (long) (Float.parseFloat(timeout) * 1000);
...@@ -717,12 +717,12 @@ public class Driver implements java.sql.Driver { ...@@ -717,12 +717,12 @@ public class Driver implements java.sql.Driver {
* This method was added in v6.5, and simply throws an SQLException for an unimplemented method. I * This method was added in v6.5, and simply throws an SQLException for an unimplemented method. I
* decided to do it this way while implementing the JDBC2 extensions to JDBC, as it should help * decided to do it this way while implementing the JDBC2 extensions to JDBC, as it should help
* keep the overall driver size down. It now requires the call Class and the function name to help * keep the overall driver size down. It now requires the call Class and the function name to help
* when the driver is used with closed software that don't report the stack strace * when the driver is used with closed software that don't report the stack trace
* *
* @param callClass the call Class * @param callClass the call Class
* @param functionName the name of the unimplemented function with the type of its arguments * @param functionName the name of the unimplemented function with the type of its arguments
* @return PSQLException with a localized message giving the complete description of the * @return PSQLException with a localized message giving the complete description of the
* unimplemeted function * unimplemented function
*/ */
public static SQLFeatureNotSupportedException notImplemented(Class<?> callClass, public static SQLFeatureNotSupportedException notImplemented(Class<?> callClass,
String functionName) { String functionName) {
......
...@@ -59,7 +59,7 @@ public interface PGConnection { ...@@ -59,7 +59,7 @@ public interface PGConnection {
* method. Returns null if there have been no notifications. A timeout can be specified so the * method. Returns null if there have been no notifications. A timeout can be specified so the
* driver waits for notifications. * driver waits for notifications.
* *
* @param timeoutMillis when 0, blocks forever. when &gt; 0, blocks up to the specified number of millies * @param timeoutMillis when 0, blocks forever. when &gt; 0, blocks up to the specified number of millis
* or until at least one notification has been received. If more than one notification is * or until at least one notification has been received. If more than one notification is
* about to be received, these will be returned in one batch. * about to be received, these will be returned in one batch.
* @return notifications that have been received * @return notifications that have been received
...@@ -253,7 +253,7 @@ public interface PGConnection { ...@@ -253,7 +253,7 @@ public interface PGConnection {
* applications via <code>getParameterStatuses()</code>.</p> * applications via <code>getParameterStatuses()</code>.</p>
* *
* <p>PgJDBC exposes individual accessors for some of these parameters as * <p>PgJDBC exposes individual accessors for some of these parameters as
* listed below. They are more backwarrds-compatible and should be preferred * listed below. They are more backwards-compatible and should be preferred
* where possible.</p> * where possible.</p>
* *
* <p>Not all parameters are reported, only those marked * <p>Not all parameters are reported, only those marked
...@@ -270,7 +270,7 @@ public interface PGConnection { ...@@ -270,7 +270,7 @@ public interface PGConnection {
* *
* <p> * <p>
* As of PostgreSQL 11 the reportable parameter list, and related PgJDBC * As of PostgreSQL 11 the reportable parameter list, and related PgJDBC
* interfaces or accesors, are: * interfaces or assessors, are:
* </p> * </p>
* *
* <ul> * <ul>
......
...@@ -317,8 +317,9 @@ public enum PGProperty { ...@@ -317,8 +317,9 @@ public enum PGProperty {
/** /**
* This property is no longer used by the driver and will be ignored. * This property is no longer used by the driver and will be ignored.
* Logging is configured via java.util.logging. * @deprecated Logging is configured via java.util.logging.
*/ */
@Deprecated
LOGGER_FILE( LOGGER_FILE(
"loggerFile", "loggerFile",
null, null,
...@@ -326,8 +327,9 @@ public enum PGProperty { ...@@ -326,8 +327,9 @@ public enum PGProperty {
/** /**
* This property is no longer used by the driver and will be ignored. * This property is no longer used by the driver and will be ignored.
* Logging is configured via java.util.logging. * @deprecated Logging is configured via java.util.logging.
*/ */
@Deprecated
LOGGER_LEVEL( LOGGER_LEVEL(
"loggerLevel", "loggerLevel",
null, null,
...@@ -607,7 +609,7 @@ public enum PGProperty { ...@@ -607,7 +609,7 @@ public enum PGProperty {
"The location of the client's SSL certificate"), "The location of the client's SSL certificate"),
/** /**
* Classname of the SSL Factory to use (instance of {@code javax.net.ssl.SSLSocketFactory}). * Classname of the SSL Factory to use (instance of {@link javax.net.ssl.SSLSocketFactory}).
*/ */
SSL_FACTORY( SSL_FACTORY(
"sslfactory", "sslfactory",
...@@ -625,8 +627,7 @@ public enum PGProperty { ...@@ -625,8 +627,7 @@ public enum PGProperty {
"Argument forwarded to constructor of SSLSocketFactory class."), "Argument forwarded to constructor of SSLSocketFactory class."),
/** /**
* Classname of the SSL HostnameVerifier to use (instance of {@code * Classname of the SSL HostnameVerifier to use (instance of {@link javax.net.ssl.HostnameVerifier}).
* javax.net.ssl.HostnameVerifier}).
*/ */
SSL_HOSTNAME_VERIFIER( SSL_HOSTNAME_VERIFIER(
"sslhostnameverifier", "sslhostnameverifier",
...@@ -634,8 +635,8 @@ public enum PGProperty { ...@@ -634,8 +635,8 @@ public enum PGProperty {
"A class, implementing javax.net.ssl.HostnameVerifier that can verify the server"), "A class, implementing javax.net.ssl.HostnameVerifier that can verify the server"),
/** /**
* File containing the SSL Key. Default will be the file {@code postgresql.pk8} in {@code * File containing the SSL Key. Default will be the file {@code postgresql.pk8} in {@code $HOME/.postgresql} (*nix)
* $HOME/.postgresql} (*nix) or {@code %APPDATA%\postgresql} (windows). * or {@code %APPDATA%\postgresql} (windows).
*/ */
SSL_KEY( SSL_KEY(
"sslkey", "sslkey",
...@@ -665,12 +666,12 @@ public enum PGProperty { ...@@ -665,12 +666,12 @@ public enum PGProperty {
/** /**
* The classname instantiating {@code javax.security.auth.callback.CallbackHandler} to use. * The classname instantiating {@link javax.security.auth.callback.CallbackHandler} to use.
*/ */
SSL_PASSWORD_CALLBACK( SSL_PASSWORD_CALLBACK(
"sslpasswordcallback", "sslpasswordcallback",
null, null,
"A class, implementing javax.security.auth.callback.CallbackHandler that can handle PassworCallback for the ssl password."), "A class, implementing javax.security.auth.callback.CallbackHandler that can handle PasswordCallback for the ssl password."),
/** /**
* <p>After requesting an upgrade to SSL from the server there are reports of the server not responding due to a failover * <p>After requesting an upgrade to SSL from the server there are reports of the server not responding due to a failover
...@@ -760,7 +761,7 @@ public enum PGProperty { ...@@ -760,7 +761,7 @@ public enum PGProperty {
* Factory class to instantiate factories for XML processing. * Factory class to instantiate factories for XML processing.
* The default factory disables external entity processing. * The default factory disables external entity processing.
* Legacy behavior with external entity processing can be enabled by specifying a value of LEGACY_INSECURE. * Legacy behavior with external entity processing can be enabled by specifying a value of LEGACY_INSECURE.
* Or specify a custom class that implements {@code org.postgresql.xml.PGXmlFactoryFactory}. * Or specify a custom class that implements {@link org.postgresql.xml.PGXmlFactoryFactory}.
*/ */
XML_FACTORY_FACTORY( XML_FACTORY_FACTORY(
"xmlFactoryFactory", "xmlFactoryFactory",
...@@ -849,18 +850,40 @@ public enum PGProperty { ...@@ -849,18 +850,40 @@ public enum PGProperty {
} }
/** /**
* Returns the value of the connection parameters according to the given {@code Properties} or the * Returns the value of the connection parameter from the given {@link Properties} or the
* default value. * default value.
* *
* @param properties properties to take actual value from * @param properties properties to take actual value from
* @return evaluated value for this connection parameter * @return evaluated value for this connection parameter
*/ */
public /* @Nullable */ String get(Properties properties) { public /* @Nullable */ String getOrDefault(Properties properties) {
return properties.getProperty(name, defaultValue); return properties.getProperty(name, defaultValue);
} }
/** /**
* Set the value for this connection parameter in the given {@code Properties}. * Returns the value of the connection parameter from the given {@link Properties} or the
* default value
* @param properties properties to take actual value from
* @return evaluated value for this connection parameter or null
* @deprecated use {@link #getOrDefault(Properties)} instead
*/
@Deprecated
public /* @Nullable */ String get(Properties properties) {
return getOrDefault(properties);
}
/**
* Returns the value of the connection parameter from the given {@link Properties} or null if there
* is no default value
* @param properties properties object to get value from
* @return evaluated value for this connection parameter
*/
public /* @Nullable */ String getOrNull(Properties properties) {
return properties.getProperty(name);
}
/**
* Set the value for this connection parameter in the given {@link Properties}.
* *
* @param properties properties in which the value should be set * @param properties properties in which the value should be set
* @param value value for this connection parameter * @param value value for this connection parameter
...@@ -874,17 +897,17 @@ public enum PGProperty { ...@@ -874,17 +897,17 @@ public enum PGProperty {
} }
/** /**
* Return the boolean value for this connection parameter in the given {@code Properties}. * Return the boolean value for this connection parameter in the given {@link Properties}.
* *
* @param properties properties to take actual value from * @param properties properties to take actual value from
* @return evaluated value for this connection parameter converted to boolean * @return evaluated value for this connection parameter converted to boolean
*/ */
public boolean getBoolean(Properties properties) { public boolean getBoolean(Properties properties) {
return Boolean.parseBoolean(get(properties)); return Boolean.parseBoolean(getOrDefault(properties));
} }
/** /**
* Return the int value for this connection parameter in the given {@code Properties}. Prefer the * Return the int value for this connection parameter in the given {@link Properties}. Prefer the
* use of {@link #getInt(Properties)} anywhere you can throw an {@link java.sql.SQLException}. * use of {@link #getInt(Properties)} anywhere you can throw an {@link java.sql.SQLException}.
* *
* @param properties properties to take actual value from * @param properties properties to take actual value from
...@@ -893,13 +916,13 @@ public enum PGProperty { ...@@ -893,13 +916,13 @@ public enum PGProperty {
*/ */
@SuppressWarnings("nullness:argument.type.incompatible") @SuppressWarnings("nullness:argument.type.incompatible")
public int getIntNoCheck(Properties properties) { public int getIntNoCheck(Properties properties) {
String value = get(properties); String value = getOrDefault(properties);
//noinspection ConstantConditions //noinspection ConstantConditions
return Integer.parseInt(value); return Integer.parseInt(value);
} }
/** /**
* Return the int value for this connection parameter in the given {@code Properties}. * Return the int value for this connection parameter in the given {@link Properties}.
* *
* @param properties properties to take actual value from * @param properties properties to take actual value from
* @return evaluated value for this connection parameter converted to int * @return evaluated value for this connection parameter converted to int
...@@ -907,7 +930,7 @@ public enum PGProperty { ...@@ -907,7 +930,7 @@ public enum PGProperty {
*/ */
@SuppressWarnings("nullness:argument.type.incompatible") @SuppressWarnings("nullness:argument.type.incompatible")
public int getInt(Properties properties) throws PSQLException { public int getInt(Properties properties) throws PSQLException {
String value = get(properties); String value = getOrDefault(properties);
try { try {
//noinspection ConstantConditions //noinspection ConstantConditions
return Integer.parseInt(value); return Integer.parseInt(value);
...@@ -918,14 +941,14 @@ public enum PGProperty { ...@@ -918,14 +941,14 @@ public enum PGProperty {
} }
/** /**
* Return the {@code Integer} value for this connection parameter in the given {@code Properties}. * Return the {@link Integer} value for this connection parameter in the given {@link Properties}.
* *
* @param properties properties to take actual value from * @param properties properties to take actual value from
* @return evaluated value for this connection parameter converted to Integer or null * @return evaluated value for this connection parameter converted to Integer or null
* @throws PSQLException if unable to parse property as integer * @throws PSQLException if unable to parse property as integer
*/ */
public /* @Nullable */ Integer getInteger(Properties properties) throws PSQLException { public /* @Nullable */ Integer getInteger(Properties properties) throws PSQLException {
String value = get(properties); String value = getOrDefault(properties);
if (value == null) { if (value == null) {
return null; return null;
} }
...@@ -938,7 +961,7 @@ public enum PGProperty { ...@@ -938,7 +961,7 @@ public enum PGProperty {
} }
/** /**
* Set the boolean value for this connection parameter in the given {@code Properties}. * Set the boolean value for this connection parameter in the given {@link Properties}.
* *
* @param properties properties in which the value should be set * @param properties properties in which the value should be set
* @param value boolean value for this connection parameter * @param value boolean value for this connection parameter
...@@ -948,7 +971,7 @@ public enum PGProperty { ...@@ -948,7 +971,7 @@ public enum PGProperty {
} }
/** /**
* Set the int value for this connection parameter in the given {@code Properties}. * Set the int value for this connection parameter in the given {@link Properties}.
* *
* @param properties properties in which the value should be set * @param properties properties in which the value should be set
* @param value int value for this connection parameter * @param value int value for this connection parameter
...@@ -958,7 +981,7 @@ public enum PGProperty { ...@@ -958,7 +981,7 @@ public enum PGProperty {
} }
/** /**
* Test whether this property is present in the given {@code Properties}. * Test whether this property is present in the given {@link Properties}.
* *
* @param properties set of properties to check current in * @param properties set of properties to check current in
* @return true if the parameter is specified in the given properties * @return true if the parameter is specified in the given properties
...@@ -968,14 +991,14 @@ public enum PGProperty { ...@@ -968,14 +991,14 @@ public enum PGProperty {
} }
/** /**
* Convert this connection parameter and the value read from the given {@code Properties} into a * Convert this connection parameter and the value read from the given {@link Properties} into a
* {@code DriverPropertyInfo}. * {@link DriverPropertyInfo}.
* *
* @param properties properties to take actual value from * @param properties properties to take actual value from
* @return a DriverPropertyInfo representing this connection parameter * @return a DriverPropertyInfo representing this connection parameter
*/ */
public DriverPropertyInfo toDriverPropertyInfo(Properties properties) { public DriverPropertyInfo toDriverPropertyInfo(Properties properties) {
DriverPropertyInfo propertyInfo = new DriverPropertyInfo(name, get(properties)); DriverPropertyInfo propertyInfo = new DriverPropertyInfo(name, getOrDefault(properties));
propertyInfo.required = required; propertyInfo.required = required;
propertyInfo.description = description; propertyInfo.description = description;
propertyInfo.choices = choices; propertyInfo.choices = choices;
......
...@@ -45,7 +45,7 @@ public interface PGResultSetMetaData { ...@@ -45,7 +45,7 @@ public interface PGResultSetMetaData {
* Is a column Text or Binary? * Is a column Text or Binary?
* *
* @param column column position (1-based) * @param column column position (1-based)
* @return 0 if column data foramt is TEXT, or 1 if BINARY * @return 0 if column data format is TEXT, or 1 if BINARY
* @throws SQLException if something wrong happens * @throws SQLException if something wrong happens
* @see Field#BINARY_FORMAT * @see Field#BINARY_FORMAT
* @see Field#TEXT_FORMAT * @see Field#TEXT_FORMAT
......
...@@ -42,7 +42,7 @@ public abstract class ConnectionFactory { ...@@ -42,7 +42,7 @@ public abstract class ConnectionFactory {
*/ */
public static QueryExecutor openConnection(HostSpec[] hostSpecs, public static QueryExecutor openConnection(HostSpec[] hostSpecs,
Properties info) throws SQLException { Properties info) throws SQLException {
String protoName = PGProperty.PROTOCOL_VERSION.get(info); String protoName = PGProperty.PROTOCOL_VERSION.getOrDefault(info);
if (protoName == null || protoName.isEmpty() || "3".equals(protoName)) { if (protoName == null || protoName.isEmpty() || "3".equals(protoName)) {
ConnectionFactory connectionFactory = new ConnectionFactoryImpl(); ConnectionFactory connectionFactory = new ConnectionFactoryImpl();
......
...@@ -122,7 +122,7 @@ public class Encoding { ...@@ -122,7 +122,7 @@ public class Encoding {
} }
/** /**
* Returns true if this encoding has characters '-' and '0'..'9' in exactly same posision as * Returns true if this encoding has characters '-' and '0'..'9' in exactly same position as
* ascii. * ascii.
* *
* @return true if the bytes can be scanned directly for ascii numbers. * @return true if the bytes can be scanned directly for ascii numbers.
......
...@@ -375,7 +375,7 @@ public class PGStream implements Closeable, Flushable { ...@@ -375,7 +375,7 @@ public class PGStream implements Closeable, Flushable {
/** /**
* Send a fixed-size array of bytes to the backend. If {@code buf.length < siz}, pad with zeros. * Send a fixed-size array of bytes to the backend. If {@code buf.length < siz}, pad with zeros.
* If {@code buf.lengh > siz}, truncate the array. * If {@code buf.length > siz}, truncate the array.
* *
* @param buf the array of bytes to be sent * @param buf the array of bytes to be sent
* @param siz the number of bytes to be sent * @param siz the number of bytes to be sent
......
...@@ -882,7 +882,7 @@ public class Parser { ...@@ -882,7 +882,7 @@ public class Parser {
*/ */
public static boolean isIdentifierStartChar(char c) { public static boolean isIdentifierStartChar(char c) {
/* /*
* PostgreSQL's implmementation is located in * PostgreSQL's implementation is located in
* pgsql/src/backend/parser/scan.l: * pgsql/src/backend/parser/scan.l:
* ident_start [A-Za-z\200-\377_] * ident_start [A-Za-z\200-\377_]
* ident_cont [A-Za-z\200-\377_0-9\$] * ident_cont [A-Za-z\200-\377_0-9\$]
......
...@@ -412,7 +412,7 @@ public interface QueryExecutor extends TypeTransferModeRegistry { ...@@ -412,7 +412,7 @@ public interface QueryExecutor extends TypeTransferModeRegistry {
* <p>Don't use this string for logic, only use it when displaying the server version to the user. * <p>Don't use this string for logic, only use it when displaying the server version to the user.
* Prefer getServerVersionNum() for all logic purposes.</p> * Prefer getServerVersionNum() for all logic purposes.</p>
* *
* @return the server version string from the server_version guc * @return the server version string from the server_version GUC
*/ */
String getServerVersion(); String getServerVersion();
......
...@@ -69,17 +69,17 @@ public abstract class QueryExecutorBase implements QueryExecutor { ...@@ -69,17 +69,17 @@ public abstract class QueryExecutorBase implements QueryExecutor {
@SuppressWarnings({"assignment.type.incompatible", "argument.type.incompatible"}) @SuppressWarnings({"assignment.type.incompatible", "argument.type.incompatible"})
protected QueryExecutorBase(PGStream pgStream, int cancelSignalTimeout, Properties info) throws SQLException { protected QueryExecutorBase(PGStream pgStream, int cancelSignalTimeout, Properties info) throws SQLException {
this.pgStream = pgStream; this.pgStream = pgStream;
this.user = PGProperty.USER.get(info); this.user = PGProperty.USER.getOrDefault(info);
this.database = PGProperty.PG_DBNAME.get(info); this.database = PGProperty.PG_DBNAME.getOrDefault(info);
this.cancelSignalTimeout = cancelSignalTimeout; this.cancelSignalTimeout = cancelSignalTimeout;
this.reWriteBatchedInserts = PGProperty.REWRITE_BATCHED_INSERTS.getBoolean(info); this.reWriteBatchedInserts = PGProperty.REWRITE_BATCHED_INSERTS.getBoolean(info);
this.columnSanitiserDisabled = PGProperty.DISABLE_COLUMN_SANITISER.getBoolean(info); this.columnSanitiserDisabled = PGProperty.DISABLE_COLUMN_SANITISER.getBoolean(info);
String callMode = PGProperty.ESCAPE_SYNTAX_CALL_MODE.get(info); String callMode = PGProperty.ESCAPE_SYNTAX_CALL_MODE.getOrDefault(info);
this.escapeSyntaxCallMode = EscapeSyntaxCallMode.of(callMode); this.escapeSyntaxCallMode = EscapeSyntaxCallMode.of(callMode);
this.quoteReturningIdentifiers = PGProperty.QUOTE_RETURNING_IDENTIFIERS.getBoolean(info); this.quoteReturningIdentifiers = PGProperty.QUOTE_RETURNING_IDENTIFIERS.getBoolean(info);
String preferMode = PGProperty.PREFER_QUERY_MODE.get(info); String preferMode = PGProperty.PREFER_QUERY_MODE.getOrDefault(info);
this.preferQueryMode = PreferQueryMode.of(preferMode); this.preferQueryMode = PreferQueryMode.of(preferMode);
this.autoSave = AutoSave.of(PGProperty.AUTOSAVE.get(info)); this.autoSave = AutoSave.of(PGProperty.AUTOSAVE.getOrDefault(info));
this.logServerErrorDetail = PGProperty.LOG_SERVER_ERROR_DETAIL.getBoolean(info); this.logServerErrorDetail = PGProperty.LOG_SERVER_ERROR_DETAIL.getBoolean(info);
// assignment.type.incompatible, argument.type.incompatible // assignment.type.incompatible, argument.type.incompatible
this.cachedQueryCreateAction = new CachedQueryCreateAction(this); this.cachedQueryCreateAction = new CachedQueryCreateAction(this);
......
...@@ -102,7 +102,7 @@ public enum ServerVersion implements Version { ...@@ -102,7 +102,7 @@ public enum ServerVersion implements Version {
* <p>The yy or zz version parts may be larger than 99. A NumberFormatException is thrown if a * <p>The yy or zz version parts may be larger than 99. A NumberFormatException is thrown if a
* version part is out of range.</p> * version part is out of range.</p>
* *
* @param serverVersion server vertion in a XXYYZZ form * @param serverVersion server version in a XXYYZZ form
* @return server version in number form * @return server version in number form
*/ */
static int parseServerVersionStr(/* @Nullable */ String serverVersion) throws NumberFormatException { static int parseServerVersionStr(/* @Nullable */ String serverVersion) throws NumberFormatException {
......
...@@ -31,13 +31,13 @@ public class SocketFactoryFactory { ...@@ -31,13 +31,13 @@ public class SocketFactoryFactory {
*/ */
public static SocketFactory getSocketFactory(Properties info) throws PSQLException { public static SocketFactory getSocketFactory(Properties info) throws PSQLException {
// Socket factory // Socket factory
String socketFactoryClassName = PGProperty.SOCKET_FACTORY.get(info); String socketFactoryClassName = PGProperty.SOCKET_FACTORY.getOrDefault(info);
if (socketFactoryClassName == null) { if (socketFactoryClassName == null) {
return SocketFactory.getDefault(); return SocketFactory.getDefault();
} }
try { try {
return ObjectFactory.instantiate(SocketFactory.class, socketFactoryClassName, info, true, return ObjectFactory.instantiate(SocketFactory.class, socketFactoryClassName, info, true,
PGProperty.SOCKET_FACTORY_ARG.get(info)); PGProperty.SOCKET_FACTORY_ARG.getOrDefault(info));
} catch (Exception e) { } catch (Exception e) {
throw new PSQLException( throw new PSQLException(
GT.tr("The SocketFactory class provided {0} could not be instantiated.", GT.tr("The SocketFactory class provided {0} could not be instantiated.",
...@@ -54,7 +54,7 @@ public class SocketFactoryFactory { ...@@ -54,7 +54,7 @@ public class SocketFactoryFactory {
* @throws PSQLException if something goes wrong * @throws PSQLException if something goes wrong
*/ */
public static SSLSocketFactory getSslSocketFactory(Properties info) throws PSQLException { public static SSLSocketFactory getSslSocketFactory(Properties info) throws PSQLException {
String classname = PGProperty.SSL_FACTORY.get(info); String classname = PGProperty.SSL_FACTORY.getOrDefault(info);
if (classname == null if (classname == null
|| "org.postgresql.ssl.jdbc4.LibPQFactory".equals(classname) || "org.postgresql.ssl.jdbc4.LibPQFactory".equals(classname)
|| "org.postgresql.ssl.LibPQFactory".equals(classname)) { || "org.postgresql.ssl.LibPQFactory".equals(classname)) {
...@@ -62,7 +62,7 @@ public class SocketFactoryFactory { ...@@ -62,7 +62,7 @@ public class SocketFactoryFactory {
} }
try { try {
return ObjectFactory.instantiate(SSLSocketFactory.class, classname, info, true, return ObjectFactory.instantiate(SSLSocketFactory.class, classname, info, true,
PGProperty.SSL_FACTORY_ARG.get(info)); PGProperty.SSL_FACTORY_ARG.getOrDefault(info));
} catch (Exception e) { } catch (Exception e) {
throw new PSQLException( throw new PSQLException(
GT.tr("The SSLSocketFactory class provided {0} could not be instantiated.", classname), GT.tr("The SSLSocketFactory class provided {0} could not be instantiated.", classname),
......
...@@ -167,7 +167,7 @@ public class Utils { ...@@ -167,7 +167,7 @@ public class Utils {
* <p>The yy or zz version parts may be larger than 99. A NumberFormatException is thrown if a * <p>The yy or zz version parts may be larger than 99. A NumberFormatException is thrown if a
* version part is out of range.</p> * version part is out of range.</p>
* *
* @param serverVersion server vertion in a XXYYZZ form * @param serverVersion server version in a XXYYZZ form
* @return server version in number form * @return server version in number form
* @deprecated use specific {@link Version} instance * @deprecated use specific {@link Version} instance
*/ */
......
...@@ -55,11 +55,11 @@ class AuthenticationPluginManager { ...@@ -55,11 +55,11 @@ class AuthenticationPluginManager {
PasswordAction<char /* @Nullable */ [], T> action) throws PSQLException, IOException { PasswordAction<char /* @Nullable */ [], T> action) throws PSQLException, IOException {
char[] password = null; char[] password = null;
String authPluginClassName = PGProperty.AUTHENTICATION_PLUGIN_CLASS_NAME.get(info); String authPluginClassName = PGProperty.AUTHENTICATION_PLUGIN_CLASS_NAME.getOrDefault(info);
if (authPluginClassName == null || authPluginClassName.equals("")) { if (authPluginClassName == null || authPluginClassName.equals("")) {
// Default auth plugin simply pulls password directly from connection properties // Default auth plugin simply pulls password directly from connection properties
String passwordText = PGProperty.PASSWORD.get(info); String passwordText = PGProperty.PASSWORD.getOrDefault(info);
if (passwordText != null) { if (passwordText != null) {
password = passwordText.toCharArray(); password = passwordText.toCharArray();
} }
...@@ -108,7 +108,7 @@ class AuthenticationPluginManager { ...@@ -108,7 +108,7 @@ class AuthenticationPluginManager {
if (password == null) { if (password == null) {
throw new PSQLException( throw new PSQLException(
GT.tr("The server requested password-based authentication, but no password was provided by plugin {0}", GT.tr("The server requested password-based authentication, but no password was provided by plugin {0}",
PGProperty.AUTHENTICATION_PLUGIN_CLASS_NAME.get(info)), PGProperty.AUTHENTICATION_PLUGIN_CLASS_NAME.getOrDefault(info)),
PSQLState.CONNECTION_REJECTED); PSQLState.CONNECTION_REJECTED);
} }
ByteBuffer buf = StandardCharsets.UTF_8.encode(CharBuffer.wrap(password)); ByteBuffer buf = StandardCharsets.UTF_8.encode(CharBuffer.wrap(password));
......
...@@ -97,8 +97,8 @@ public class ConnectionFactoryImpl extends ConnectionFactory { ...@@ -97,8 +97,8 @@ public class ConnectionFactoryImpl extends ConnectionFactory {
SslMode sslMode, GSSEncMode gssEncMode) SslMode sslMode, GSSEncMode gssEncMode)
throws SQLException, IOException { throws SQLException, IOException {
int connectTimeout = PGProperty.CONNECT_TIMEOUT.getInt(info) * 1000; int connectTimeout = PGProperty.CONNECT_TIMEOUT.getInt(info) * 1000;
String user = PGProperty.USER.get(info); String user = PGProperty.USER.getOrDefault(info);
String database = PGProperty.PG_DBNAME.get(info); String database = PGProperty.PG_DBNAME.getOrDefault(info);
if (user == null) { if (user == null) {
throw new PSQLException(GT.tr("User cannot be null"), PSQLState.INVALID_NAME); throw new PSQLException(GT.tr("User cannot be null"), PSQLState.INVALID_NAME);
} }
...@@ -114,7 +114,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory { ...@@ -114,7 +114,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory {
newStream.setNetworkTimeout(socketTimeout * 1000); newStream.setNetworkTimeout(socketTimeout * 1000);
} }
String maxResultBuffer = PGProperty.MAX_RESULT_BUFFER.get(info); String maxResultBuffer = PGProperty.MAX_RESULT_BUFFER.getOrDefault(info);
newStream.setMaxResultBuffer(maxResultBuffer); newStream.setMaxResultBuffer(maxResultBuffer);
// Enable TCP keep-alive probe if required. // Enable TCP keep-alive probe if required.
...@@ -192,7 +192,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory { ...@@ -192,7 +192,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory {
GSSEncMode gssEncMode = GSSEncMode.of(info); GSSEncMode gssEncMode = GSSEncMode.of(info);
HostRequirement targetServerType; HostRequirement targetServerType;
String targetServerTypeStr = castNonNull(PGProperty.TARGET_SERVER_TYPE.get(info)); String targetServerTypeStr = castNonNull(PGProperty.TARGET_SERVER_TYPE.getOrDefault(info));
try { try {
targetServerType = HostRequirement.getTargetServerType(targetServerTypeStr); targetServerType = HostRequirement.getTargetServerType(targetServerTypeStr);
} catch (IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {
...@@ -355,12 +355,12 @@ public class ConnectionFactoryImpl extends ConnectionFactory { ...@@ -355,12 +355,12 @@ public class ConnectionFactoryImpl extends ConnectionFactory {
paramList.add(new String[]{"DateStyle", "ISO"}); paramList.add(new String[]{"DateStyle", "ISO"});
paramList.add(new String[]{"TimeZone", createPostgresTimeZone()}); paramList.add(new String[]{"TimeZone", createPostgresTimeZone()});
Version assumeVersion = ServerVersion.from(PGProperty.ASSUME_MIN_SERVER_VERSION.get(info)); Version assumeVersion = ServerVersion.from(PGProperty.ASSUME_MIN_SERVER_VERSION.getOrDefault(info));
if (assumeVersion.getVersionNum() >= ServerVersion.v9_0.getVersionNum()) { if (assumeVersion.getVersionNum() >= ServerVersion.v9_0.getVersionNum()) {
// User is explicitly telling us this is a 9.0+ server so set properties here: // User is explicitly telling us this is a 9.0+ server so set properties here:
paramList.add(new String[]{"extra_float_digits", "3"}); paramList.add(new String[]{"extra_float_digits", "3"});
String appName = PGProperty.APPLICATION_NAME.get(info); String appName = PGProperty.APPLICATION_NAME.getOrDefault(info);
if (appName != null) { if (appName != null) {
paramList.add(new String[]{"application_name", appName}); paramList.add(new String[]{"application_name", appName});
} }
...@@ -369,17 +369,17 @@ public class ConnectionFactoryImpl extends ConnectionFactory { ...@@ -369,17 +369,17 @@ public class ConnectionFactoryImpl extends ConnectionFactory {
paramList.add(new String[]{"extra_float_digits", "2"}); paramList.add(new String[]{"extra_float_digits", "2"});
} }
String replication = PGProperty.REPLICATION.get(info); String replication = PGProperty.REPLICATION.getOrDefault(info);
if (replication != null && assumeVersion.getVersionNum() >= ServerVersion.v9_4.getVersionNum()) { if (replication != null && assumeVersion.getVersionNum() >= ServerVersion.v9_4.getVersionNum()) {
paramList.add(new String[]{"replication", replication}); paramList.add(new String[]{"replication", replication});
} }
String currentSchema = PGProperty.CURRENT_SCHEMA.get(info); String currentSchema = PGProperty.CURRENT_SCHEMA.getOrDefault(info);
if (currentSchema != null) { if (currentSchema != null) {
paramList.add(new String[]{"search_path", currentSchema}); paramList.add(new String[]{"search_path", currentSchema});
} }
String options = PGProperty.OPTIONS.get(info); String options = PGProperty.OPTIONS.getOrDefault(info);
if (options != null) { if (options != null) {
paramList.add(new String[]{"options", options}); paramList.add(new String[]{"options", options});
} }
...@@ -453,7 +453,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory { ...@@ -453,7 +453,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory {
/* /*
let's see if the server will allow a GSS encrypted connection let's see if the server will allow a GSS encrypted connection
*/ */
String user = PGProperty.USER.get(info); String user = PGProperty.USER.getOrDefault(info);
if (user == null) { if (user == null) {
throw new PSQLException("GSSAPI encryption required but was impossible user is null", PSQLState.CONNECTION_REJECTED); throw new PSQLException("GSSAPI encryption required but was impossible user is null", PSQLState.CONNECTION_REJECTED);
} }
...@@ -498,8 +498,8 @@ public class ConnectionFactoryImpl extends ConnectionFactory { ...@@ -498,8 +498,8 @@ public class ConnectionFactoryImpl extends ConnectionFactory {
try { try {
AuthenticationPluginManager.withPassword(AuthenticationRequestType.GSS, info, password -> { AuthenticationPluginManager.withPassword(AuthenticationRequestType.GSS, info, password -> {
org.postgresql.gss.MakeGSS.authenticate(true, pgStream, host, user, password, org.postgresql.gss.MakeGSS.authenticate(true, pgStream, host, user, password,
PGProperty.JAAS_APPLICATION_NAME.get(info), PGProperty.JAAS_APPLICATION_NAME.getOrDefault(info),
PGProperty.KERBEROS_SERVER_NAME.get(info), false, // TODO: fix this PGProperty.KERBEROS_SERVER_NAME.getOrDefault(info), false, // TODO: fix this
PGProperty.JAAS_LOGIN.getBoolean(info), PGProperty.JAAS_LOGIN.getBoolean(info),
PGProperty.LOG_SERVER_ERROR_DETAIL.getBoolean(info)); PGProperty.LOG_SERVER_ERROR_DETAIL.getBoolean(info));
return void.class; return void.class;
...@@ -732,7 +732,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory { ...@@ -732,7 +732,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory {
* GSSAPI and the other end isn't using Kerberos for SSPI then authentication will * GSSAPI and the other end isn't using Kerberos for SSPI then authentication will
* fail. * fail.
*/ */
final String gsslib = PGProperty.GSS_LIB.get(info); final String gsslib = PGProperty.GSS_LIB.getOrDefault(info);
final boolean usespnego = PGProperty.USE_SPNEGO.getBoolean(info); final boolean usespnego = PGProperty.USE_SPNEGO.getBoolean(info);
boolean useSSPI = false; boolean useSSPI = false;
...@@ -749,7 +749,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory { ...@@ -749,7 +749,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory {
"Using JSSE GSSAPI, gssapi requested by server and gsslib=sspi not forced"); "Using JSSE GSSAPI, gssapi requested by server and gsslib=sspi not forced");
} else { } else {
/* Determine if SSPI is supported by the client */ /* Determine if SSPI is supported by the client */
sspiClient = createSSPI(pgStream, PGProperty.SSPI_SERVICE_CLASS.get(info), sspiClient = createSSPI(pgStream, PGProperty.SSPI_SERVICE_CLASS.getOrDefault(info),
/* Use negotiation for SSPI, or if explicitly requested for GSS */ /* Use negotiation for SSPI, or if explicitly requested for GSS */
areq == AUTH_REQ_SSPI || (areq == AUTH_REQ_GSS && usespnego)); areq == AUTH_REQ_SSPI || (areq == AUTH_REQ_GSS && usespnego));
...@@ -779,8 +779,8 @@ public class ConnectionFactoryImpl extends ConnectionFactory { ...@@ -779,8 +779,8 @@ public class ConnectionFactoryImpl extends ConnectionFactory {
/* Use JGSS's GSSAPI for this request */ /* Use JGSS's GSSAPI for this request */
AuthenticationPluginManager.withPassword(AuthenticationRequestType.GSS, info, password -> { AuthenticationPluginManager.withPassword(AuthenticationRequestType.GSS, info, password -> {
org.postgresql.gss.MakeGSS.authenticate(false, pgStream, host, user, password, org.postgresql.gss.MakeGSS.authenticate(false, pgStream, host, user, password,
PGProperty.JAAS_APPLICATION_NAME.get(info), PGProperty.JAAS_APPLICATION_NAME.getOrDefault(info),
PGProperty.KERBEROS_SERVER_NAME.get(info), usespnego, PGProperty.KERBEROS_SERVER_NAME.getOrDefault(info), usespnego,
PGProperty.JAAS_LOGIN.getBoolean(info), PGProperty.JAAS_LOGIN.getBoolean(info),
PGProperty.LOG_SERVER_ERROR_DETAIL.getBoolean(info)); PGProperty.LOG_SERVER_ERROR_DETAIL.getBoolean(info));
return void.class; return void.class;
...@@ -868,7 +868,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory { ...@@ -868,7 +868,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory {
private void runInitialQueries(QueryExecutor queryExecutor, Properties info) private void runInitialQueries(QueryExecutor queryExecutor, Properties info)
throws SQLException { throws SQLException {
String assumeMinServerVersion = PGProperty.ASSUME_MIN_SERVER_VERSION.get(info); String assumeMinServerVersion = PGProperty.ASSUME_MIN_SERVER_VERSION.getOrDefault(info);
if (Utils.parseServerVersionStr(assumeMinServerVersion) >= ServerVersion.v9_0.getVersionNum()) { if (Utils.parseServerVersionStr(assumeMinServerVersion) >= ServerVersion.v9_0.getVersionNum()) {
// We already sent the parameter values in the StartupMessage so skip this // We already sent the parameter values in the StartupMessage so skip this
return; return;
...@@ -884,7 +884,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory { ...@@ -884,7 +884,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory {
SetupQueryRunner.run(queryExecutor, "SET extra_float_digits = 3", false); SetupQueryRunner.run(queryExecutor, "SET extra_float_digits = 3", false);
} }
String appName = PGProperty.APPLICATION_NAME.get(info); String appName = PGProperty.APPLICATION_NAME.getOrDefault(info);
if (appName != null && dbVersion >= ServerVersion.v9_0.getVersionNum()) { if (appName != null && dbVersion >= ServerVersion.v9_0.getVersionNum()) {
StringBuilder sql = new StringBuilder(); StringBuilder sql = new StringBuilder();
sql.append("SET application_name = '"); sql.append("SET application_name = '");
......
...@@ -807,7 +807,7 @@ public class QueryExecutorImpl extends QueryExecutorBase { ...@@ -807,7 +807,7 @@ public class QueryExecutorImpl extends QueryExecutorBase {
timeoutMillis += startTime - newTimeMillis; // Overflows after 49 days, ignore that timeoutMillis += startTime - newTimeMillis; // Overflows after 49 days, ignore that
startTime = newTimeMillis; startTime = newTimeMillis;
if (timeoutMillis == 0) { if (timeoutMillis == 0) {
timeoutMillis = -1; // Don't accidentially wait forever timeoutMillis = -1; // Don't accidentally wait forever
} }
} }
break; break;
...@@ -1683,7 +1683,7 @@ public class QueryExecutorImpl extends QueryExecutorBase { ...@@ -1683,7 +1683,7 @@ public class QueryExecutorImpl extends QueryExecutorBase {
// be received from a client. If we have a bigger value // be received from a client. If we have a bigger value
// from either very large parameters or incorrect length // from either very large parameters or incorrect length
// descriptions of setXXXStream we do not send the bind // descriptions of setXXXStream we do not send the bind
// messsage. // message.
// //
if (encodedSize > 0x3fffffff) { if (encodedSize > 0x3fffffff) {
throw new PGBindException(new IOException(GT.tr( throw new PGBindException(new IOException(GT.tr(
......
...@@ -109,7 +109,7 @@ public class PGPooledConnection implements PooledConnection { ...@@ -109,7 +109,7 @@ public class PGPooledConnection implements PooledConnection {
/** /**
* Gets a handle for a client to use. This is a wrapper around the physical connection, so the * Gets a handle for a client to use. This is a wrapper around the physical connection, so the
* client can call close and it will just return the connection to the pool without really closing * client can call close and it will just return the connection to the pool without really closing
* the pgysical connection. * the physical connection.
* *
* <p> * <p>
* According to the JDBC 2.0 Optional Package spec (6.2.3), only one client may have an active * According to the JDBC 2.0 Optional Package spec (6.2.3), only one client may have an active
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment