How to create collection with java api?

Hi to all,
does anyone know, how to create collection with java API?
thanks

I don’t think there is a mechanism to do this directly.
I think it is a consequence of defining a schema.

Thank you for quick reply, Mark Kuschnir.
But if I want to define a schema using java API, the collection in which the schema will be defined, must be avaraible. That is, the collection must be created at first. Do you mean, that there is no such mechanism to create collection with java API and I must create the collection manually at first?

Are you sure that you need the collection before being able to define the schema?

If I define a schema using TII then the collection is automatically created if need be.

Have you just tried doing a define and providing the collection name?

Hello Mark Kuschnir.
I have tried to do a schema define without creating the collection before. You are right. The collection is automatically created. Thank you a lot for your help.
I have one more question. How to delete the collection per java API? Is it possible even the collection is not empty?

I think you should be able to either undefine a doctype or even possibly a collection.

Please remember that undefining a doctype or a collection will delete all related documents!

Thanks, Mark Kuschnir,
I made it. As you said, to delete a collection is as same as to undefine it.