title: Error connecting to phpmyadmin
body: <p>So i'm using netbeans and i have the basic code to make a connection to my database in phpmyadmin but it's giving me error and i can't figure out why.</p>
  
  <pre><code>    public Connection getConnection(){
  
      Connection con;
      try{
          Class.forName("com.mysql.jdbc.Driver");
          con = DriverManager.getConnection("jdbc:mysql://localhost/test", "root", "");
          return con;
      }catch(Exception e){
          e.printStackTrace();
          return null;
      }
  }
  </code></pre>
  
  <p>I do have the <code>mysql-connector-java-5.1.46-bin</code> file in the library but it's still giving me this:</p>
  
  <pre><code>    java.sql.SQLException: No suitable driver found for 
  jdbc:mysql//localhost/test
  at java.sql.DriverManager.getConnection(DriverManager.java:689)
  at java.sql.DriverManager.getConnection(DriverManager.java:247                                    
  at bdaysms.Main.getConnection(Main.java:20)
  at bdaysms.Main.getContactsList(Main.java:31)
  at bdaysms.Main.Show_Users(Main.java:53)
  at bdaysms.Main.&lt;init&gt;(Main.java:12)
  at bdaysms.Main$4.run(Main.java:272)
  at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
  at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
  at java.awt.EventQueue.access$500(EventQueue.java:97)
  at java.awt.EventQueue$3.run(EventQueue.java:709)
  at java.awt.EventQueue$3.run(EventQueue.java:703)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
  at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
  at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
      java.lang.NullPointerException
  at bdaysms.Main.getContactsList(Main.java:38)
  at bdaysms.Main.Show_Users(Main.java:53)
  at bdaysms.Main.&lt;init&gt;(Main.java:12)
  at bdaysms.Main$4.run(Main.java:272)
  at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
  at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
  at java.awt.EventQueue.access$500(EventQueue.java:97)
  at java.awt.EventQueue$3.run(EventQueue.java:709)
  at java.awt.EventQueue$3.run(EventQueue.java:703)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
  at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
  at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
  </code></pre>
  
  <p>Is there something wrong with my code or am i missing something to connect? </p>