The driver supports Internet Protocol (IP) addresses in IPv4 and IPv6 format. To connect to IPv6 addresses, the client or application server requires Java SE 5 or higher.
The server name specified in a connection URL, or data source, can resolve to an IPv4 or IPv6 address. For example, the following URL can resolve to either type of address:
Alternately, you can specify addresses using IPv4 or IPv6 format in the server portion of the connection URL. For example, the following connection URL specifies the server using IPv4 format:
You also can specify addresses in either format using the ServerName data source property. The following example shows a data source definition that specifies the server name using IPv6 format:
RedshiftDataSource mds = new RedshiftDataSource();
mds.setDescription("My RedshiftDataSource");
mds.setServerName("[ABCD:EF01:2345:6789:ABCD:EF01:2345:6789]");
...
Note: When specifying IPv6 addresses in a connection URL or data source property, the address must be enclosed by brackets.
In addition to the normal IPv6 format, the drivers support IPv6 alternative formats for compressed and IPv4/IPv6 combination addresses. For example, the following connection URL specifies the server using IPv6 format, but uses the compressed syntax for strings of zero bits: