To create a Java program that simulates a simple ATM machine, you'll need to have the following:

1. Java Development Kit (JDK) installed on your computer.
2. MySQL Server and MySQL Connector/J (JDBC driver for MySQL) installed.

Here's an example of how you can create this program:

1. First, create a new database in MySQL and a table named `users` with columns `id`, `pin`, `balance`, and `transaction_history`.

```sql
CREATE DATABASE atm;
USE atm;

CREATE TABLE users (
  id INT AUTO_INCREMENT PRIMARY KEY,
  pin VARCHAR(4) NOT NULL,
  balance DECIMAL(10, 2) NOT NULL DEFAULT 0,
  transaction_history TEXT
);
```

2. Add some sample data to the `users` table.

```sql
INSERT INTO users (pin, balance)
VALUES ('1234', 1000), ('5678', 2000);
```

3. Create a Java class named `ATM.java` and add the following code:

```java
import java.sql.*;
import java.util.Scanner;

public class ATM {
    private static final String DB_URL = "jdbc:mysql://localhost:3306/atm";
    private static final String DB_USER = "root"; // Replace with your MySQL username
    private static final String DB_PASSWORD = ""; // Replace with your MySQL password

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("Welcome to the ATM!");
        System.out.print("Enter your PIN: ");
        String pin = scanner.nextLine();

        try (Connection connection = DriverManager.getConnection(DB_URL, DB_USER, DB_PASSWORD)) {
            PreparedStatement statement = connection.prepareStatement("SELECT * FROM users WHERE pin = ?");
            statement.setString(1, pin);
            ResultSet resultSet = statement.executeQuery();

            if (!resultSet.next()) {
                System.out.println("Invalid PIN. Exiting...");
                return;
            }

            int userId = resultSet.getInt("id");
            double balance = resultSet.getDouble("balance");

            while (true) {
                System.out.println("\nChoose an option:");
                System.out.println("1. Check Balance");
                System.out.println("2. Deposit Money");
                System.out.println("3. Withdraw Money");
                System.out.println("4. Exit");
                System.out.print("Enter your choice: ");
                int choice = scanner.nextInt();

                switch (choice) {
                    case 1:
                        System.out.printf("Your current balance is $%.2f\n", balance);
                        break;
                    case 2:
                        System.out.print("Enter the amount to deposit: ");
                        double depositAmount = scanner.nextDouble();
                        balance += depositAmount;
                        updateBalance(connection, userId, balance);
                        System.out.printf("$%.2f deposited successfully.\n", depositAmount);
                        break;
                    case 3:
                        System.out.print("Enter the amount to withdraw: ");
                        double withdrawalAmount = scanner.nextDouble();
                        if (withdrawalAmount > balance) {
                            System.out.println("Insufficient funds.");
                        } else {
                            balance -= withdrawalAmount;
                            updateBalance(connection, userId, balance);
                            System.out.printf("$%.2f withdrawn successfully.\n", withdrawalAmount);
                        }
                        break;
                    case 4:
                        System.out.println("Thank you for using our ATM. Goodbye!");
                        return;
                    default:
                        System.out.println("Invalid choice. Please try again.");
                }
            }
        } catch (SQLException e) {
            System.err.println("Error connecting to the database: " + e.getMessage());
        }
    }

    private static void updateBalance(Connection connection, int userId, double newBalance) throws SQLException {
        PreparedStatement statement = connection.prepareStatement("UPDATE users SET balance = ? WHERE id = ?");
        statement.setDouble(1, newBalance);
        statement.setInt(2, userId);
        statement.executeUpdate();
    }
}
```

4. Compile and run the program:

```bash
javac -cp /path/to/mysql-connector-java-x.x.xx.jar ATM.java
java -cp .:/path/to/mysql-connector-java-x.x.xx.jar ATM
```

Replace `/path/to/mysql-connector-java-x.x.xx.jar` with the path to your MySQL Connector/J JAR file.

Now you have a simple Java program that simulates an ATM machine using a MySQL database. Users can enter their PIN, check their balance, deposit money, and withdraw money. The program interacts with the MySQL database to store user information and transaction history.
간단한 ATM 기계를 시뮬레이션하는 Java 프로그램을 만들려면 다음이 필요합니다.

1. 컴퓨터에 설치된 JDK(Java 개발 키트)
2. MySQL 서버 및 MySQL Connector/J(MySQL용 JDBC 드라이버)가 설치되어 있어야 합니다.

이 프로그램을 만드는 방법에 대한 예는 다음과 같습니다.

1. 먼저 MySQL에 새 데이터베이스를 생성하고 `id`, `pin`, `balance`, `transaction_history` 열이 있는 `users`라는 이름의 테이블을 생성합니다.

```sql
CREATE DATABASE atm;
USE atm;

CREATE TABLE users (
  id INT AUTO_INCREMENT PRIMARY KEY,
  pin VARCHAR(4) NOT NULL,
  balance DECIMAL(10, 2) NOT NULL DEFAULT 0,
  transaction_history TEXT
);
```

2. 사용자` 테이블에 몇 가지 샘플 데이터를 추가합니다.

```sql
INSERT INTO users (pin, balance)
VALUES ('1234', 1000), ('5678', 2000);
```

3. `ATM.java`라는 Java 클래스를 생성하고 다음 코드를 추가합니다:

```java
import java.sql.*;
import java.util.Scanner;

public class ATM {
    private static final String DB_URL = "jdbc:mysql://localhost:3306/atm";
    private static final String DB_USER = "root"; // Replace with your MySQL username
    private static final String DB_PASSWORD = ""; // Replace with your MySQL password

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("Welcome to the ATM!");
        System.out.print("Enter your PIN: ");
        String pin = scanner.nextLine();

        try (Connection connection = DriverManager.getConnection(DB_URL, DB_USER, DB_PASSWORD)) {
            PreparedStatement statement = connection.prepareStatement("SELECT * FROM users WHERE pin = ?");
            statement.setString(1, pin);
            ResultSet resultSet = statement.executeQuery();

            if (!resultSet.next()) {
                System.out.println("Invalid PIN. Exiting...");
                return;
            }

            int userId = resultSet.getInt("id");
            double balance = resultSet.getDouble("balance");

            while (true) {
                System.out.println("\nChoose an option:");
                System.out.println("1. Check Balance");
                System.out.println("2. Deposit Money");
                System.out.println("3. Withdraw Money");
                System.out.println("4. Exit");
                System.out.print("Enter your choice: ");
                int choice = scanner.nextInt();

                switch (choice) {
                    case 1:
                        System.out.printf("Your current balance is $%.2f\n", balance);
                        break;
                    case 2:
                        System.out.print("Enter the amount to deposit: ");
                        double depositAmount = scanner.nextDouble();
                        balance += depositAmount;
                        updateBalance(connection, userId, balance);
                        System.out.printf("$%.2f deposited successfully.\n", depositAmount);
                        break;
                    case 3:
                        System.out.print("Enter the amount to withdraw: ");
                        double withdrawalAmount = scanner.nextDouble();
                        if (withdrawalAmount > balance) {
                            System.out.println("Insufficient funds.");
                        } else {
                            balance -= withdrawalAmount;
                            updateBalance(connection, userId, balance);
                            System.out.printf("$%.2f withdrawn successfully.\n", withdrawalAmount);
                        }
                        break;
                    case 4:
                        System.out.println("Thank you for using our ATM. Goodbye!");
                        return;
                    default:
                        System.out.println("Invalid choice. Please try again.");
                }
            }
        } catch (SQLException e) {
            System.err.println("Error connecting to the database: " + e.getMessage());
        }
    }

    private static void updateBalance(Connection connection, int userId, double newBalance) throws SQLException {
        PreparedStatement statement = connection.prepareStatement("UPDATE users SET balance = ? WHERE id = ?");
        statement.setDouble(1, newBalance);
        statement.setInt(2, userId);
        statement.executeUpdate();
    }
}
```

4. 프로그램을 컴파일하고 실행합니다:

```bash
javac -cp /path/to/mysql-connector-java-x.x.xx.jar ATM.java
java -cp .:/path/to/mysql-connector-java-x.x.xx.jar ATM
```

경로/to/mysql-connector-java-x.x.xx.jar`를 MySQL Connector/J JAR 파일의 경로로 바꿉니다.

이제 MySQL 데이터베이스를 사용하여 ATM 기계를 시뮬레이션하는 간단한 Java 프로그램이 완성되었습니다. 사용자는 PIN을 입력하고, 잔액을 확인하고, 돈을 입금하고, 인출할 수 있습니다. 이 프로그램은 MySQL 데이터베이스와 상호 작용하여 사용자 정보 및 거래 내역을 저장합니다.