db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: cleaning derby db
Date Mon, 12 Dec 2005 10:30:20 GMT
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 

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.


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.

View raw message