title: How to connect mariadb with java into windows?
body: <p>I have Netbean IDE 7.3.1 in windows XP with DataBase MariaDB.
  But not connecting...
  this class code ConexionDB.java:</p>
  
  <pre><code>import java.sql.Connection;
  import java.sql.DriverManager;
  import javax.naming.NamingException;
  
  public class ConexionDB {
      private String enlace;
      private String controlador;
      private String error;
      private String usuario;
      private String contrasenia;
  
      public ConexionDB(){
          this.enlace = "jdbc:mariadb://localhost:3306/test";
          this.controlador = "org.mariadb.jdbc.Driver";
          this.error = " ";
          this.usuario = "root";
          this.contrasenia = "mariadb";
      }
  
      public Connection abrirConexion() throws NamingException{
          try{
              Class.forName(getEnlace()).newInstance();
              return DriverManager.getConnection(getEnlace(), getUsuario(), getContrasenia());
          }catch (Exception e){
              setError(e.getMessage());
              System.out.println("error al conectar " + getError());
          }
          return null;
      }
  
      public void cerrarConexion(Connection salida){
          try{
              salida.close();
          }catch(Exception e){
              setError(e.getMessage());
              System.out.println("error al conectar " + getError());
          }
  
      }
  </code></pre>
  
  <p>And this code Main.Java</p>
  
  <pre><code>import java.sql.Connection;
  import java.sql.SQLException;
  import javax.naming.NamingException;
  import javax.swing.JOptionPane;
  
  public class Main {
      public static void main(String[] args) throws NamingException, SQLException{
          ConexionDB instanciaDB = new ConexionDB();
          Connection actualDB;
          actualDB = instanciaDB.abrirConexion();
  
          if(actualDB != null)
              JOptionPane.showMessageDialog(null, "Conexion Realiazada Correctamete!");
      }
  }
  </code></pre>
  
  <p>Always I've the same error over Output:
  error al conectar jdbc:mariadb://localhost:3306/test
  [error to connect jdbc:mariadb://localhost:3306/test]
  Any idea in this problem!
  Grettings.</p>