Hi,
I got only 8 tables, and use this method:
public static Connection deleteRepository(Connection conn) throws
Exception {
Statement stat = conn.createStatement();
executeSilently(stat, "DROP TABLE default_binval", false);
executeSilently(stat, "DROP TABLE default_node", false);
executeSilently(stat, "DROP TABLE default_prop", false);
executeSilently(stat, "DROP TABLE default_refs", false);
executeSilently(stat, "DROP TABLE version_binval", false);
executeSilently(stat, "DROP TABLE version_node", false);
executeSilently(stat, "DROP TABLE version_prop", false);
executeSilently(stat, "DROP TABLE version_refs", false);
return conn;
}
To delete the whole repository, you probably also want to delete the
repository directory:
static void deleteRecursive(File file) throws IOException {
if(file.isDirectory()) {
File[] list = file.listFiles();
for(int i=0; i<list.length; i++) {
deleteRecursive(list[i]);
}
}
if(file.exists() && !file.delete()) {
throw new IOException("Could not delete " + file.getAbsolutePath());
}
}
I hope that helps,
Thomas
On 7/10/07, Mihai Anescu <[EMAIL PROTECTED]> wrote:
Hi again
I have set up my repository in a DB.
I'm using a JBoss server.
So now I have about 10 tables in a schema, for the JR repository,
workspace and versioning.
I would like to know if there is a way to run a SQL script when I start
the server. I want to clean the repository of existing data.