title: How to Connect with MySQL Database File( .sql ) using Directory Path Like MS Access?
body: <p>Sorry Maybe this is the second time I am Asking this question because of not getting any answers .</p>
  
  <p>this is my Code </p>
  
  <pre><code>    try{
      File  f = new File("Database.sql");
      if(f.exists()){
          Class.forName("com.mysql.jdbc.Driver").newInstance();
          Connection con = DriverManager.getConnection("jdbc:mysql://localhost/"+f.getName(),"","");
      }else{
          f.createNewFile();
          System.out.println("file created");
          //also do the connection
      }
      }catch(Exception ex){
         System.out.println(ex.getMessage());
      }
  </code></pre>
  
  <p>and Here is the error :</p>
  
  <p><em><strong>Communications link failure
  The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.</em></strong></p>
  
  <p>The purpose of this question is:
  I am creating an Application that is for many users, the problem is they don't know anything about computer and I must make it as simple as possible.</p>
  
  <p>So <strong>is there any way to connect with MYSQL like MS ACCESS via Directory Path ?</strong></p>
  
  <p>OR is there any other suggestion instead ?</p>
  
  <p>Thanks .</p>