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

public class Connect {
   static public void main(String[] args) {
      Connection conn = null;

      try {
         ResourceBundle bdl = ResourceBundle.getBundle("connect"); 
         String url = bdl.getString("url");
         Properties p = new Propertes();; 
         Enumeration keys = bdl.keys();

         while( keys.hasMoreElements() ) {
            String prop = (String)keys.nextElement(); 
            String val = bdl.getString(prop);

            p.setProperty(prop, val);
         }
         Class.forName(bld.getString("driver")).newInstance();
         conn = DriverManager.getConnection(url, p);
      }
      catch(SQLException e) { 
         e.printStackTrace();
      }
      finally {
         if( conn != null ) {
            try { conn.close(); }
            catch( SQLException e ) { }
         }
      }
   }
} 
