Sure, here's an example Java code snippet that demonstrates how to connect to a database and retrieve data from multiple tables:

```
import java.sql.*;

public class DatabaseExample {
   public static void main(String[] args) {
      try(Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mydatabase", "username", "password")) {
         String query = "SELECT * FROM CUSTOMER_TABLE "
                + "JOIN ORDER_TABLE ON CUSTOMER_TABLE.customer_id = ORDER_TABLE.customer_id "
                + "JOIN COST_TABLE ON ORDER_TABLE.order_id = COST_TABLE.order_id";
         
         PreparedStatement preparedStatement = conn.prepareStatement(query);
         ResultSet resultSet = preparedStatement.executeQuery();

         while (resultSet.next()) {
            int orderId = resultSet.getInt("order_id");
            String customerName = resultSet.getString("customer_name");
            double cost = resultSet.getDouble("cost");

            System.out.println("Order ID: " + orderId + ", Customer Name: " + customerName + ", Cost: " + cost);
         }
      } catch(SQLException ex) {
         ex.printStackTrace();
      }
   }
}
```
In this example, we are connecting to a MySQL database on localhost and retrieving data from three tables (CUSTOMER_TABLE, ORDER_TABLE, and COST_TABLE) using a JOIN operation. We store the data in a ResultSet object and print it to the console. Note that you will need to replace "mydatabase", "username", and "password" with your specific database name, username, and password.
Nome tabella: ORDER_TABLE, CUSTOMER_TABLE, COST_TABLE.
Ho un database e ho bisogno di accedervi in Java. Scrivi codice di esempio di come posso farlo.