Hello Y.,

You could of course delete the database directory itself, but then you would have to recreate the database and schema/table definitions afterwards.

Apart from that, I don't know of any other way to delete all records from the database in Derby than to issue a 'DELETE FROM <table>' for all tables in the database.

You could try to use the trick described in Jira entry DERBY-268 (http://issues.apache.org/jira/browse/DERBY-268), where import with replace is used to delete/ovewrite the existing table. (The link listed is broken. Please open the reference manual on http://db.apache.org/derby/manuals/ and find the entry for SYSCS_UTIL.SYSCS_IMPORT_TABLE).


I guess you have to choose the approach that suit your needs best based on your application characteristics.


If you have additional questions, I (or somebody else on the list) will try to answer them.



--
Kristian


Yuval wrote:
Hi,

I'm using Derby db in my application. I'm starting the db by using
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();

and starting ti by calling

DriverManager.getConnection ("jdbc:derby:aaa;create=true");


How can I delete all the records in my db?

Thanks,

Y.

Reply via email to