Question

I don't know java but as you can see from this question (Oracle Regular Expression (REGEXP_LIKE) Too Long Error - ORA-12733) java seems to be the easiest to accomplish validating if an IPv6 address is formatted correctly. I tried regular expressions, came close, but was a nightmare, and the expression is too long for PL/SQL.

I have the java in Oracle way working. I only want to validate the format, not that the address really exists. So does java.net.Inet6Address.getByName literally go out and see if the address exists?

The documentation says... (http://docs.oracle.com/javase/1.5.0/docs/api/java/net/InetAddress.html#getByName(java.lang.String))

"If a literal IP address is supplied, only the validity of the address format is checked."

I'm taking that as it does NOT ping, am I understanding that correctly?

Was it helpful?

Solution

That is a correct understanding - it does not issue an ICMP PING.

However, it must "Go Out" to resolve the host-name (via DNS).

Of course, when an IP literal supplied, then there is no need to resolve as such .. Use this method only if attempting a name resolve is OK/desired. Be wary when using it to generally check for the validity of an IP literal.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top