Here you can find the source of deleteFromAllTables(Connection con)
private static void deleteFromAllTables(Connection con) throws SQLException
//package com.java2s; /*//from w w w . j a v a2 s . c o m * Artifactory is a binaries repository manager. * Copyright (C) 2013 JFrog Ltd. * * Artifactory is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Artifactory is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Artifactory. If not, see <http://www.gnu.org/licenses/>. */ import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; public class Main { /** * A list of all the tables in the database */ public static String[] tables = new String[] { "db_properties", "artifactory_servers", "stats_remote", "stats", "watches", "node_props", "node_meta_infos", "nodes", "indexed_archives_entries", "archive_names", "archive_paths", "indexed_archives", "binary_blobs", "binaries", "aces", "acls", "users_groups", "groups", "user_props", "users", "permission_target_repos", "permission_targets", "configs", "tasks", "module_props", "build_props", "build_jsons", "build_promotions", "build_dependencies", "build_artifacts", "build_modules", "builds", "unique_ids" }; private static void deleteFromAllTables(Connection con) throws SQLException { for (String table : tables) { try (Statement statement = con.createStatement()) { statement.execute("DELETE FROM " + table); } } } }