Data definition language (DDL) statements are rarely used anywhere. Often, they are used in scripts that are processed by a SQL front end, initiated manually.
However, programming the SQL front end requires that some Java (C, C++, what have you) programs are directly applying DDL on the database.
Similarly, if you have a large application, it is often necessary to provide a set of maintenance screens, available to highly privileged users, which emit DDL statements. For example, certain kinds of maintenance activities might require dropping and recreating tables, changing indices, and adding or removing triggers. By providing the capability in your program, you can significantly reduce the chance of errors by constraining operations in kind or in time.
Finally, testing of database-oriented applications requires that the test scaffolding be able to emit DDL in many circumstances.