Re: Need solution for MySQL Not connected problem
Posted by: Filipe Silva
Date: January 12, 2019 04:26AM

A `com.mysql.jdbc.CommunicationsException` always contains a message explaining the reason for the failure. For example:

Exception in thread "main" java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(
at com.mysql.jdbc.MysqlIO.doHandshake(
at com.mysql.jdbc.ConnectionImpl.coreConnect(
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(
at com.mysql.jdbc.ConnectionImpl.createNewIO(

In your case it seems that this `DbUtil` class is catching the exception and omitting out some details from it. I need the missing details in order to be able to help you. Please print the full stack trace as you get it from Connector/J.

Btw, what version of Connector/J are you using?

Options: ReplyQuote

Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.