We have created a web application hosted on virtual machine for client access through web only, no distribution . The database we have used is MySQL Community Edition under GPL 2. The application is connected to MySQL though MySQL Java connector. Are there any impediments in this case considering GPL 2.
The use of a MySQL database server has no effect on your software. The GPL only extends to derivative works of the GPL-covered software. Most likely, just communicating with a separate process is not enough to create a derivative work.
However, the use of a GPL-covered library in your application means that your application would be subject to the GPL as well. You do not have to publish your software, so this is typically not a problem for server-side software. However, if you give anyone else a copy of the software then you can only do so under the terms of the GPL.
If this is a problem for you, you could look for an alternative MySQL client library, or put the code that communicates with MySQL into a program that is clearly separate and independent of your main code, e.g. a kind of storage microservice. Or you could buy a commercial license, which seems to be the point of keeping the official Java connector under the GPL.
An even better solution might be to look at MariaDB (a highly compatible fork of MySQL after Oracle acquired MySQL). The MariaDB connector is available under the LGPL license, which imposes no license requirements on you as long as you keep the connector in a separate JAR. The MariaDB connector might still be compatible with a MySQL server, but of course this is not guaranteed.