Hi Bassam,
"useSSL=false" is the culprit.
The default authentication mechanism in MySQL is
caching_sha2_password, which requires a secure connection on the first authentication and subsequent authentications are possible from an insecure channel.
So, first time you authenticate with Workbench you add your credentials to the authentication cache. Next time you create a Connector/J connection this cache is used.
If the authentication cache is empty, then you won't be able to connect from Connector/J, unless you enable SSL at least once.
BTW, in Connector/J 8.0 I'd recommend using the
connection option 'sslMode' instead of 'useSSL', that exists only for compatibility purposes.
IHTH