public static void main(String[] args) {
		
		try {
			/* Returns the Class object associated with the class or 
			 * interface with the given string name.
			 */
			Class.forName("com.mysql.jdbc.Driver");
		} catch (ClassNotFoundException e) {
			System.out.println("MySQL JDBC Driver not found.");
			e.printStackTrace();
			return;
		}
	 
		System.out.println("MySQL JDBC Driver Registered!");
		
		/* A connection (session) with a specific database. SQL statements 
		 * are executed and results are returned within the context of a connection.
		 */
		Connection connection = null;
		PreparedStatement preparedStatement = null;
	 
		try {
			// DriveManager is the basic service for managing a set of JDBC drivers.
			connection = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306","root", "11181begin");
		} catch (SQLException e) {
			System.out.println("Connection Failed! Check output console\n" + e.getMessage());
			return;
		} 
	 
		// Successful database connection section.
		if (connection != null) {
			System.out.println("Connected to the database successfully!");
			

			System.out.println("----------Diamonds Searcher----------\n"
					+ "Please select two of the following criteria by entering their numbers: ");
			
	        System.out.println("(1) Search by carat\n"
	        		+ "(2) Search by cut\n"
	        		+ "(3) Search by color\n"
	        		+ "(4) Search by clarity\n"
	        		+ "(5) Search by depth\n"
	        		+ "(6) Search by price\n");
	        
	        System.out.print("First criteria: ");
	        criteriaInputValidator();
	        criteriaSelector(criteriaInput);
	        
	        System.out.print("Second criteria: ");	        
	        criteriaInputValidator();
	        criteriaSelector(criteriaInput);
	        
	        
	        // Execute the query, print results, and close the , ResultSet, PreparedStatement, and Connection objects.
			try {
			    selectSQLQuery = "SELECT * FROM CUNY_DB.diamonds WHERE " + 
	        			dataColumn1 + "='" + data1 + "' AND "+ 
	        			dataColumn2 + "='" + data2 + "';";
			    
		        System.out.println(selectSQLQuery);

				preparedStatement = connection.prepareStatement(selectSQLQuery);
				ResultSet queryResults = preparedStatement.executeQuery();
				
				System.out.println("\n----------Diamonds Results----------\n");
				System.out.print(String.format("%-10s", "ID", "%10s"));			
				System.out.print(String.format("%-10s", "Carat", "%10s"));
				System.out.print(String.format("%-10s", "Cut", "%10s"));
				System.out.print(String.format("%-10s", "Color", "%10s"));
				System.out.print(String.format("%-10s", "Clarity", "%10s"));
				System.out.print(String.format("%-10s", "Depth", "%10s"));
				System.out.print(String.format("%-10s", "Price", "%10s") + "\n");
				
				while (queryResults.next()) {
					System.out.print(String.format("%-10s", queryResults.getInt(1), "%10s"));			
					System.out.print(String.format("%-10s", queryResults.getDouble(2), "%10s"));
					System.out.print(String.format("%-10s", queryResults.getString(3), "%10s"));
					System.out.print(String.format("%-10s", queryResults.getString(4), "%10s"));
					System.out.print(String.format("%-10s", queryResults.getString(5), "%10s"));
					System.out.print(String.format("%-10s", queryResults.getDouble(6), "%10s"));
					System.out.print(String.format("%-10s", queryResults.getInt(7), "%10s") + "\n");
				}
				queryResults.close();
				preparedStatement.close();
				connection.close();
			} catch (SQLException e) {
				e.printStackTrace();
			}
			
		} else {
			System.out.println("Failed to make connection!");
		}
	}