skip to main content
Using the driver : IP Addresses
  

Try DataDirect Drivers Now

IP Addresses

The driver supports Internet Protocol (IP) addresses in IPv4 and IPv6 format.
The HostName specified in the connection URL can resolve to an IPv4 or IPv6 address. For example, the following URL can resolve to an IPv4 or IPv6 address.
jdbc:datadirect:mongodb://MyServer:27017;DatabaseName=Test;
SchemaMap=MyUserProfile\\AppData\\Local\\Progress\\DataDirect\\MongoDB_Schema\\MyServer.config
You can specify addresses using IPv4 or IPv6 format in the host portion of the connection URL. For example, the following connection URL specifies the host using IPv4 format.
jdbc:datadirect:mongodb://123.456.78.90:27017;DatabaseName=Test;
SchemaMap=MyUserProfile\\AppData\\Local\\Progress\\DataDirect\\MongoDB_Schema\\MyServer.config
You can also specify addresses in either format using the ServerName data source property. The following example shows a data source that specifies the host in IPv6 format using the setServerName method.
MongoDBDataSource mds = new MongoDBDataSource();
mds.setDescription("My MongoDBDataSource");
mds.setServerName("[ABCD:EF01:2345:6789:ABCD:EF01:2345:6789]");
...
Note: When specifying IPv6 addresses or IPv4/IPv6 combination 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 host with IPv6 format, but uses the compressed syntax for strings of zero bits.
jdbc:datadirect:mongodb://[2001:DB8:0:0:8:800:200C:417A]:27017;DatabaseName=Test;
SchemaMap=MyUserProfile\\AppData\\Local\\Progress\\DataDirect\\MongoDB_Schema\\MyServer.config
Similarly, the following connection URL specifies the host using an IPv4/IPv6 combination address.
jdbc:datadirect:mongodb://
[0000:0000:0000:0000:0000:FFFF:123.456.78.90]:27017;DatabaseName=Test;
SchemaMap=MyUserProfile\\AppData\\Local\\Progress\\DataDirect\\MongoDB_Schema\\MyServer.config
For complete information about IPv6, visit the following Web page.
http://tools.ietf.org/html/rfc4291#section-2.2