I have a big problem! when I do this:
String query = \"SELECT * FROM utente WHERE confermato=1 and Username=\'\" + username + \"\' AND Password
Edit your my.cnf(ubunut) or my.ini(windows) file and set max_allowed_packet size.
max_allowed_packet=512M
Then restart your mysql server.It will work