This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
I am trying to connect to mysql database. I am using try catch while establishing connection.
I want that I should be able to know what exception was caught, so that, I can show appropriate error message.
e.g if I pass incorrect hostname, i should show Wrong hostname provided.
One way to do is get class name of runtime exception class. but nested exception is being thrown like this..
There was some error while establishing connection to the databasecom.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
** END NESTED EXCEPTION **
Last packet sent to the server was 1 ms ago.
Problem in establishing connection.