title: ConnectionException using Java MariaDB Connector
body: <p>i want to establish a connection between my Java Program and my Database created with MariaDB on a different server (not localhost). Everything is fine with the ServerIP, Databasename, User and Password.
  But i get this error:</p>
  <pre><code>Exception in thread &quot;main&quot; java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=MY_SERVER_IP)(port=3306)(type=master) : Connection timed out: connect
  at org.mariadb.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:136)
  at org.mariadb.jdbc.internal.SQLExceptionMapper.throwException(SQLExceptionMapper.java:106)
  at org.mariadb.jdbc.Driver.connect(Driver.java:106)
  at java.sql.DriverManager.getConnection(Unknown Source)
  at java.sql.DriverManager.getConnection(Unknown Source)
  at MySQL_Tester.LoadDriver.main(LoadDriver.java:11)
  Caused by: org.mariadb.jdbc.internal.common.QueryException: Could not connect to address=        (host=MY_SERVER_IP)(port=3306)(type=master) : Connection timed out: connect
  at org.mariadb.jdbc.internal.mysql.MySQLProtocol.connectWithoutProxy(MySQLProtocol.java:629)
  at org.mariadb.jdbc.internal.common.Utils.retrieveProxy(Utils.java:541)
  at org.mariadb.jdbc.Driver.connect(Driver.java:101)
  ... 3 more
  Caused by: java.net.ConnectException: Connection timed out: connect
  at java.net.DualStackPlainSocketImpl.connect0(Native Method)
  at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
  at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
  at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
  at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
  at java.net.PlainSocketImpl.connect(Unknown Source)
  at java.net.SocksSocketImpl.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at org.mariadb.jdbc.internal.mysql.MySQLProtocol.connect(MySQLProtocol.java:288)
  at org.mariadb.jdbc.internal.mysql.MySQLProtocol.connectWithoutProxy(MySQLProtocol.java:624)
  ... 5 more
  </code></pre>
  <p>My Code:</p>
  <pre><code>package MySQL_Tester;
  import java.sql.*;
  
  public class LoadDriver {
  
  static Connection sqlHandler = null;
  
  public static void main(String[]args) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException {
      Class.forName(&quot;org.mariadb.jdbc.Driver&quot;).newInstance();
      sqlHandler=DriverManager.getConnection(&quot;jdbc:mysql://MY_SERVER_IP/DATABASENAME?user=USERNAME&amp;password=PASSWORD&quot;);
      
  
  }}
  </code></pre>
  <p>All the versions i use:</p>
  <ul>
  <li><p>MariaDB: 10.1.44</p>
  </li>
  <li><p>MariaDB-Java-Connector: mariadb-java-client.1.2.0.jar</p>
  </li>
  <li><p>Java Version: Version 8 Update 161</p>
  </li>
  <li><p>Eclipse Version: 2019-03 (4.11.0)</p>
  </li>
  </ul>