To create a Java program that interacts with a Cassandra database, you'll need to follow these steps:

1. Install and set up the Cassandra database.
2. Create a keyspace and table in Cassandra for storing book information.
3. Add the DataStax Java Driver for Apache Cassandra as a dependency in your Java project.
4. Write Java code to connect to the Cassandra database, insert data, and retrieve data.

Here's an example of how to accomplish this:

**Step 1: Install and set up the Cassandra database**

Follow the instructions on the official [Cassandra website](http://cassandra.apache.org/doc/latest/getting_started/installing.html) to install and start the Cassandra database.

**Step 2: Create a keyspace and table in Cassandra**

Open the `cqlsh` command-line tool by running `cqlsh` in your terminal or command prompt. Then execute the following commands to create a keyspace and table for storing book information:

```sql
CREATE KEYSPACE IF NOT EXISTS library WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};

USE library;

CREATE TABLE IF NOT EXISTS books (
    id UUID PRIMARY KEY,
    title TEXT,
    author TEXT,
    publication_date DATE,
    genre TEXT
);
```

**Step 3: Add the DataStax Java Driver for Apache Cassandra as a dependency**

Add the following Maven dependency to your `pom.xml` file:

```xml
<dependencies>
    ...
    <dependency>
        <groupId>com.datastax.oss</groupId>
        <artifactId>java-driver-core</artifactId>
        <version>4.13.0</version>
    </dependency>
    ...
</dependencies>
```

Or add the following Gradle dependency to your `build.gradle` file:

```groovy
dependencies {
    ...
    implementation 'com.datastax.oss:java-driver-core:4.13.0'
    ...
}
```

**Step 4: Write Java code to connect, insert data, and retrieve data**

Create a new Java class called `CassandraBooksExample` with the following content:

```java
import com.datastax.oss.driver.api.core.CqlSession;
import com.datastax.oss.driver.api.core.cql.ResultSet;
import com.datastax.oss.driver.api.core.cql.Row;

import java.time.LocalDate;
import java.util.UUID;

public class CassandraBooksExample {

    public static void main(String[] args) {
        // Connect to the Cassandra database
        try (CqlSession session = CqlSession.builder().withKeyspace("library").build()) {
            // Insert a book into the books table
            UUID bookId = UUID.randomUUID();
            String title = "The Catcher in the Rye";
            String author = "J.D. Salinger";
            LocalDate publicationDate = LocalDate.of(1951, 7, 16);
            String genre = "Fiction";

            String insertQuery = "INSERT INTO books (id, title, author, publication_date, genre) VALUES (?, ?, ?, ?, ?)";
            session.execute(insertQuery, bookId, title, author, publicationDate, genre);

            System.out.println("Inserted book: " + title);

            // Retrieve all books from the books table
            ResultSet resultSet = session.execute("SELECT * FROM books");

            System.out.println("\nRetrieved books:");
            for (Row row : resultSet) {
                System.out.printf("%s by %s (%s) - Genre: %s%n",
                        row.getString("title"),
                        row.getString("author"),
                        row.getLocalDate("publication_date"),
                        row.getString("genre"));
            }
        }
    }
}
```

Run the `CassandraBooksExample` class, and you should see output similar to the following:

```
Inserted book: The Catcher in the Rye

Retrieved books:
The Catcher in the Rye by J.D. Salinger (1951-07-16) - Genre: Fiction
```

This example demonstrates how to connect to a Cassandra database, insert data into the `books` table, and retrieve all rows from the table using the DataStax Java Driver for Apache Cassandra.
Create a Java program that interacts with a Cassandra database to store and retrieve information about books, including title, author, publication date, and genre.
