title: Connect to MySQL through SSH and by using Spring Boot
body: <p>In my <code>Spring Boot</code>app WAR, I have an <code>application.properties</code> file wherein I have defined following <code>datasource</code> properties:</p>
  
  <pre><code>spring.datasource.url=jdbc:mysql://localhost/test?autoReconnect=true&amp;useSSL=false&amp;rewriteBatchedStatements=true
  spring.datasource.username=used
  spring.datasource.password=password
  spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  </code></pre>
  
  <p>with this, I am able to connect to the database.</p>
  
  <p>Now, I want to connect to another database through <code>SSH tunnel</code>. How should I specify <code>spring.datasource.url</code> to get such connection?</p>
  
  <p>Please note I don't want to write any boiler plate Java code to do this SSH tunneling!</p>
  
  <p><em>P.S. I Googled but could not find satisfactory answer anywhere.</em></p>