title: phpMyAdmin and Java Connection
body: <p>I am trying to connect my java program to a database that i have created using phpmyadmin using a university server. so the database is on the university server. how do i get the connection to the db from the java program? i have tried this code, but it gives me an error message?</p>
  
  <pre><code>import java.sql.Connection; 
  import java.sql.DriverManager; 
  import java.sql.PreparedStatement;
  import java.sql.ResultSet;
  
  public class Connector {
      Connection con;
      PreparedStatement stmt;
      ResultSet rs;
  
      Connector()
      {
      try{
  
          Class.forName("com.mysql.jdbc.Driver");
          con=DriverManager.getConnection("https://NAMEHIDDEN.soi.city.ac.uk:5454/~kdhy546","root","");
  
                      stmt=con.prepareStatement("select * from staff where username=? and password=?");
                      }
  
      catch (Exception e) 
      {
          System.out.println(e);
      }
  }
  }
  </code></pre>
  
  <p>I am not too sure even, whether this is the correct url to the database? how do i determine the exact link to the database in phpmyadmin?</p>