com.mysql.jdbc.PacketTooBigException java
<p>I'm having this problem when trying to connect to my database. Change the value of the variable but still this error persists</p>

<p>Value mysql</p>

<pre><code>@@max_allowed_packet
16777216
</code></pre>

<p>Java Code</p>

<pre><code>Properties connProps = new Properties();
connProps.put("user", Config.DB_USER);
connProps.put("password", Config.DB_PASS);
this._conn = DriverManager.getConnection("jdbc:" + Config.DB_DBMS + "://" + Config.DB_HOST + ":"
  + Config.DB_PORT + "/" + Config.DB_NAME, connProps);
</code></pre>

<p>Error : </p>

<pre><code>com.mysql.jdbc.PacketTooBigException: Packet for query is too large (4739923 &gt; 1048576). You can change this value on the server by setting the max_allowed_packet' variable.
</code></pre>

<p>Modify the <code>my.cnf</code> file on my server</p>