Are you using Hibernate or EJB3? If so, you could set hibernate.hbm2ddl.auto to "create" or "create-drop".
If you are using JDBC directly, or EJB2.x, you will probably have to use database tools to drop the tables or the table contents. Or you could have a servlets init method fire off the JDBC request.
It`s EJB3.0 project.
If so, you could set hibernate.hbm2ddl.auto to "create" or "create-drop".
For me it seems like a property to allow appserver to drop table`s but there is nothing how to force such procedure.
I`ve found a vendor specific solution for Postges but for sure that`s not what i want because the only place in project where i refer to postgres is in projectname-ds file in deploy directory and of course it may be changed to oracle ...etc.So such a utility to reset database shouldn`t depend on database vendor.
Use "create-drop". The tables will be created at strup and dropped at shutdown (or perhaps simply replaced on next startup, I haven't watched the behavior that closely).