To create a Java program that reads data from a MariaDB database table and performs basic CRUD operations, you'll need to follow these steps:

1. Install the MariaDB JDBC driver
2. Set up a MariaDB database and create a table for testing
3. Write the Java code to perform CRUD operations

Here's an example of how to do this:

Step 1: Install the MariaDB JDBC driver

Add the following dependency to your `pom.xml` file if you're using Maven:

```xml
<dependency>
    <groupId>org.mariadb.jdbc</groupId>
    <artifactId>mariadb-java-client</artifactId>
    <version>2.7.3</version>
</dependency>
```

Or add the following to your `build.gradle` file if you're using Gradle:

```groovy
implementation 'org.mariadb.jdbc:mariadb-java-client:2.7.3'
```

Step 2: Set up a MariaDB database and create a table for testing

Create a new database in MariaDB and run the following SQL script to create a sample table called `employees`:

```sql
CREATE TABLE employees (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(50) NOT NULL,
    position VARCHAR(50) NOT NULL,
    salary DECIMAL(10, 2) NOT NULL
);
```

Step 3: Write the Java code to perform CRUD operations

Create a new Java class called `MariaDBCrudExample.java` with the following content:

```java
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class MariaDBCrudExample {

    private static final String DB_URL = "jdbc:mariadb://localhost:3306/your_database_name";
    private static final String DB_USER = "your_username";
    private static final String DB_PASSWORD = "your_password";

    public static void main(String[] args) {
        try {
            // 1. Connect to the database
            Connection connection = DriverManager.getConnection(DB_URL, DB_USER, DB_PASSWORD);

            // 2. Create a new record (INSERT)
            String insertSql = "INSERT INTO employees (name, position, salary) VALUES (?, ?, ?)";
            PreparedStatement insertStatement = connection.prepareStatement(insertSql);
            insertStatement.setString(1, "John Doe");
            insertStatement.setString(2, "Software Engineer");
            insertStatement.setDouble(3, 80000.0);
            int rowsInserted = insertStatement.executeUpdate();
            System.out.println(rowsInserted + " row(s) inserted.");

            // 3. Read all records (SELECT)
            String selectSql = "SELECT * FROM employees";
            Statement selectStatement = connection.createStatement();
            ResultSet resultSet = selectStatement.executeQuery(selectSql);
            while (resultSet.next()) {
                int id = resultSet.getInt("id");
                String name = resultSet.getString("name");
                String position = resultSet.getString("position");
                double salary = resultSet.getDouble("salary");
                System.out.printf("%d: %s (%s) - $%.2f%n", id, name, position, salary);
            }

            // 4. Update a record (UPDATE)
            String updateSql = "UPDATE employees SET salary = ? WHERE name = ?";
            PreparedStatement updateStatement = connection.prepareStatement(updateSql);
            updateStatement.setDouble(1, 85000.0);
            updateStatement.setString(2, "John Doe");
            int rowsUpdated = updateStatement.executeUpdate();
            System.out.println(rowsUpdated + " row(s) updated.");

            // 5. Delete a record (DELETE)
            String deleteSql = "DELETE FROM employees WHERE name = ?";
            PreparedStatement deleteStatement = connection.prepareStatement(deleteSql);
            deleteStatement.setString(1, "John Doe");
            int rowsDeleted = deleteStatement.executeUpdate();
            System.out.println(rowsDeleted + " row(s) deleted.");

            // 6. Close the connection
            connection.close();

        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
```

Replace `your_database_name`, `your_username`, and `your_password` with your actual database name, username, and password.

Now you can run the `MariaDBCrudExample.java` file to see the CRUD operations in action.
MariaDB 데이터베이스 테이블에서 데이터를 읽고 기본 CRUD 작업을 수행하는 Java 프로그램을 만들려면 다음 단계를 따라야 합니다.

1. MariaDB JDBC 드라이버를 설치합니다
2. MariaDB 데이터베이스를 설정하고 테스트용 테이블을 생성합니다
3. CRUD 연산을 수행하는 Java 코드 작성

이것을 수행하는 방법의 예는 다음과 같습니다.

1단계: MariaDB JDBC 드라이버 설치

Maven을 사용하는 경우 `pom.xml` 파일에 다음 종속성을 추가합니다:

```xml
<dependency>
    <groupId>org.mariadb.jdbc</groupId>
    <artifactId>mariadb-java-client</artifactId>
    <version>2.7.3</version>
</dependency>
```

또는 Gradle을 사용하는 경우 `build.gradle` 파일에 다음을 추가합니다:

```groovy
implementation 'org.mariadb.jdbc:mariadb-java-client:2.7.3'
```

2단계: MariaDB 데이터베이스 설정 및 테스트용 테이블 생성

MariaDB에서 새 데이터베이스를 만들고 다음 SQL 스크립트를 실행하여 `employees`라는 샘플 테이블을 생성합니다:

```sql
CREATE TABLE employees (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(50) NOT NULL,
    position VARCHAR(50) NOT NULL,
    salary DECIMAL(10, 2) NOT NULL
);
```

3단계: CRUD 작업을 수행하는 Java 코드 작성

다음 내용을 포함하는 `MariaDBCrudExample.java`라는 새 Java 클래스를 만듭니다:

```java
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class MariaDBCrudExample {

    private static final String DB_URL = "jdbc:mariadb://localhost:3306/your_database_name";
    private static final String DB_USER = "your_username";
    private static final String DB_PASSWORD = "your_password";

    public static void main(String[] args) {
        try {
            // 1. Connect to the database
            Connection connection = DriverManager.getConnection(DB_URL, DB_USER, DB_PASSWORD);

            // 2. Create a new record (INSERT)
            String insertSql = "INSERT INTO employees (name, position, salary) VALUES (?, ?, ?)";
            PreparedStatement insertStatement = connection.prepareStatement(insertSql);
            insertStatement.setString(1, "John Doe");
            insertStatement.setString(2, "Software Engineer");
            insertStatement.setDouble(3, 80000.0);
            int rowsInserted = insertStatement.executeUpdate();
            System.out.println(rowsInserted + " row(s) inserted.");

            // 3. Read all records (SELECT)
            String selectSql = "SELECT * FROM employees";
            Statement selectStatement = connection.createStatement();
            ResultSet resultSet = selectStatement.executeQuery(selectSql);
            while (resultSet.next()) {
                int id = resultSet.getInt("id");
                String name = resultSet.getString("name");
                String position = resultSet.getString("position");
                double salary = resultSet.getDouble("salary");
                System.out.printf("%d: %s (%s) - $%.2f%n", id, name, position, salary);
            }

            // 4. Update a record (UPDATE)
            String updateSql = "UPDATE employees SET salary = ? WHERE name = ?";
            PreparedStatement updateStatement = connection.prepareStatement(updateSql);
            updateStatement.setDouble(1, 85000.0);
            updateStatement.setString(2, "John Doe");
            int rowsUpdated = updateStatement.executeUpdate();
            System.out.println(rowsUpdated + " row(s) updated.");

            // 5. Delete a record (DELETE)
            String deleteSql = "DELETE FROM employees WHERE name = ?";
            PreparedStatement deleteStatement = connection.prepareStatement(deleteSql);
            deleteStatement.setString(1, "John Doe");
            int rowsDeleted = deleteStatement.executeUpdate();
            System.out.println(rowsDeleted + " row(s) deleted.");

            // 6. Close the connection
            connection.close();

        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
```

`your_database_name`, `your_username`, `your_password`를 실제 데이터베이스 이름, 사용자 이름, 비밀번호로 바꿉니다.

이제 `MariaDBCrudExample.java` 파일을 실행하여 CRUD 작업이 실제로 수행되는 것을 확인할 수 있습니다.