9.4 Getting Connections

<..Connect.java..>
 import java.sql.*;
 
 public class Connect {
   public static void main(String args[]) {
     try {
       Class.forName("com.mysql.jdbc.Driver");
       String url = "jdbc:mysql://localhost/test";
       Connection con =
            DriverManager.getConnection(url);
 
       if(!con.isClosed()){
         System.out.println("Hurray!");
         con.close();
       }
     } catch(Exception e) { System.err.println("error"); }
 } }
-_-_-