title: JDBC connecting MySQL script need help using ScriptRunner
body: <p>I have a Java application and i need it to connect with my MySQL database's SQL script using JDBC. </p>
  
  <p>Here is my Java application:</p>
  
  <pre class="lang-java prettyprint-override"><code>/*
   * To change this template, choose Tools | Templates
   * and open the template in the editor.
   */
  package basic;
  import basic.ScriptRunner;
  import javax.swing.*;
  import java.sql.*;
  import java.io.*;
  
  /**
   *
   * @author User
   */
  public class javaconnect {
      Connection conn = null;
      public static Connection ConnectDb(){
  try{
  Class.forName("com.mysql.jdbc.Driver");
  Connection conn= (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/new","login","pass");
  /*As we are creating a connection on a local computer we will write the url as jdbc:mysql://localhost:3306 */
  ScriptRunner runner = new ScriptRunner(conn, false, false);
  runner.runScript(new BufferedReader(new FileReader("D://Java Lenti/EkonomiSoftware/src/basic/new.sql")));
  
  return conn ;
  }
  catch(Exception e){
      JOptionPane.showMessageDialog(null, e);
  return null;}
  
  
  }
  
  }
  </code></pre>
  
  <p>The problem is that the Java application connects through MySQL Server, not through the SQL Script. I think the problem is at Connection parameters I gave. Can anyone guide me how to change the connection to make it connect to the SQL script not to the server?</p>