The most common way to create a multi-level collection type in JDBC is to pass an SQL CREATE TYPE statement to the execute method of the java.sql.Statement class.
The following code creates a level 1 nested table first_level and a level 2 nested table second_level:
Connection conn = .... // Establish a database connection.
Statement st = conn.createStatement(); // Open the database cursor.
st.execute("CREATE TYPE first_level AS TABLE OF NUMBER"); // Create a nested table of numbers.
st.execute("CREATE TYPE second_level AS TABLE OF first_level"); // Create a level 2 nested table.
...
st.close(); // Release the resources.
conn.close(); // Close the database connection.
After a multi-level collection type is created, you can use it as a column of a bae table and an attribute of an object type.