public enum ProtocolVersion extends java.lang.Enum<ProtocolVersion>
Enum Constant and Description |
---|
v3_0
Protocol version 3.0
|
v3_2
Protocol version 3.2
|
Modifier and Type | Method and Description |
---|---|
static ProtocolVersion |
fromMajorMinor(int major,
int minor) |
int |
getMajor()
Gets the major version number.
|
int |
getMinor()
Gets the minor version number.
|
java.lang.String |
toString() |
static ProtocolVersion |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ProtocolVersion[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ProtocolVersion v3_0
public static final ProtocolVersion v3_2
public static ProtocolVersion[] values()
for (ProtocolVersion c : ProtocolVersion.values()) System.out.println(c);
public static ProtocolVersion valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static ProtocolVersion fromMajorMinor(int major, int minor) throws java.sql.SQLException
major
- (int): The major version number of the protocol.minor
- (int): The minor version number of the protocol.java.sql.SQLException
- if the requested protocol version is not supported.
Performs a simple validation check to ensure that only supported protocol versions are used.
Currently, the PostgreSQL JDBC driver only supports protocol versions 3.0 and 3.2.public int getMajor()
public int getMinor()
public java.lang.String toString()
toString
in class java.lang.Enum<ProtocolVersion>
Copyright © 2025 PostgreSQL Global Development Group. All rights reserved.