问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/21922752/does-java-net-inet6address-getbyname-literally-go-out-and-see-if-the-address-exi