Search code examples
javadatabasederby

Unable to drop schema in derby


Here as you can see I have a schema with name MySchema

MySchema database

But now I wanted to delete it
Dropping schema

But it is not working and showing me the error saying "Encountered EOF" : enter image description here

How could I delete this schema?

Using java-8, netbeans-8, and execution was being made using Client driver i.e. org.apache.derby.jdbc.ClientDriver


Solution

  • You need to add the restrict keyword to the end of your command, e.g.

    drop schema myschema restrict;
    

    This enforces the rule that no objects can be defined in the schema when it is to be deleted.