title: Unable to connect mysql to my tomcat application
body: <p>I have been trying to connect mysql database to my tomcat9 application. I don't know where the problem is? </p>
  
  <pre><code>Class.forName("com.mysql.jdbc.Driver");
  Connection con=DriverManager.getConnection
  ("jdbc:mysql://127.0.0.1:3306/abc","root","root");
  
  mysql&gt; status
  --------------
  mysql  Ver 14.14 Distrib 5.7.26, for Linux (x86_64) using  EditLine wrapper
  
  Connection id:      49
  Current database:   
  Current user:       root@localhost
  SSL:            Not in use
  Current pager:      stdout
  Using outfile:      ''
  Using delimiter:    ;
  Server version:     5.7.26-0ubuntu0.18.04.1 (Ubuntu)
  Protocol version:   10
  Connection:     127.0.0.1 via TCP/IP
  Server characterset:    latin1
  Db     characterset:    latin1
  Client characterset:    utf8
  Conn.  characterset:    utf8
  TCP port:       3306
  Uptime:         23 hours 19 min 46 sec
  
  Threads: 5  Questions: 1043  Slow queries: 0  Opens: 188  Flush tables: 1  Open tables: 181  Queries per second avg: 0.012
  --------------
  </code></pre>
  
  <p>How do I know if my tomcat webapp is connected to mysql.</p>