title: Cannot connect to remote database using Java and Mariadb
body: <p>I am 97% sure that I have set my java web application correctly but I still get an error which points to missing the Mariadb connector or something that is close to that. I have tried to fix it but to no avail... I have</p>
  
  <ul>
  <li>added the depencency for mariadb in <code>pom.xml</code> file <em>(shown in first image)</em></li>
  <li>checked that the <code>.jar</code> file is there. <em>(shown in first image)</em></li>
  <li>tried to clean and rebuild...</li>
  </ul>
  
  <p><strong>Upon checking the <em>GlashFish Server</em> tab on run, I can read this :</strong></p>
  
  <blockquote>
    <p>java.lang.ClassNotFoundException : com.mariadb.jdbc.Driver <br>
    at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1580) <br>
    at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1430) <br>
    ... and at least 20 more locations.</p>
  </blockquote>
  
  <p><img src="https://i.imgur.com/D93myAw.png" alt=""></p>
  
  <hr>
  
  <p>Here I am trying to print the result in console to see if my application managed to connect to the remote database server, but I get nothing since it seems to crash <strong>before</strong> at the line <code>Class.forName("com.mariadb.jdbc.Driver");</code> which I have found to be the right syntax for mariadb jdbc on their <a href="https://mariadb.com/kb/en/library/about-mariadb-connector-j/" rel="nofollow noreferrer">website</a>. To save you time, they are saying that this is the <em>legacy way</em> of doing this, but that it still works. I did try to remove all the parameters from the url connection to only the user and password in <code>getConnection();</code> line, but it still fails. Am I missing something?</p>
  
  <p><em>To avoid confusion in the screenshot, myddns.link is including :3306 so that is not the error.</em></p>
  
  <p><img src="https://i.imgur.com/buKyAzG.png" alt=""></p>