import java.sql.*;
import java.util.Properties;

public class Connect {
   static public void main(String[] args) {
      Connection conn = null;
      try {
         String url = "jdbc:mysql:/localhost/Web"; 
         Properties p = new Properties();
         Class.forName("org.gjt.mm.mysql.Driver").
            newInstance(); 
            p.put("user", "dvl"); 
            p.put("password", "password"); 
            conn = DriverManager.getConnection(url, p); 
      }
      catch( SQLException e ) {
          e.printStackTrace(); 
      } 
      finally {
         if( conn != null ) {
            try { conn.close(); } 
            catch( SQLException e ) { } 
         }
      }
   }
}
