Here you can find the source of deleteOldData(Connection connection, PreparedStatement stmt, String funcId)
private static void deleteOldData(Connection connection, PreparedStatement stmt, String funcId) throws Exception
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.PreparedStatement; public class Main { private final static String DELETE_PARAM_SQL = "delete from P_S_PARAM_SQL t where t.param_id in (select p.param_id from p_s_param p where p.func_id = ?)"; private final static String DELETE_PARAM_CRITERIA = "delete from P_S_PARAM_CRITERIA t where t.sql_id in (select s.sql_id from p_s_sqlarea s where s.func_id = ?)"; private final static String DELETE_PARAM = "delete from P_S_PARAM t where t.func_id = ?"; private final static String DELETE_COLUMN = "delete from P_S_COLUMN t where t.func_id = ?"; private final static String DELETE_SQLAREA = "delete from P_S_SQLAREA t where t.func_id = ?"; private final static String DELETE_BLOCK = "delete from P_S_BLOCK t where t.func_id = ?"; private final static String DELETE_FUNC = "delete from P_S_FUNC t where t.func_id = ?"; private final static String DELETE_BLOCK_CHART = "delete from P_S_BLOCK_CHART t where t.func_id = ?"; private final static String DELETE_BLOCK_MTABLE = "delete from P_S_BLOCK_MTABLE t where t.func_id = ?"; private final static String DELETE_BLOCK_CUSTOMISE = "delete from P_S_BLOCK_CUSTOMIZE t where t.func_id = ?"; private static void deleteOldData(Connection connection, PreparedStatement stmt, String funcId) throws Exception { stmt = connection.prepareStatement(DELETE_PARAM_SQL); stmt.setString(1, funcId);/* ww w . ja v a2 s . c om*/ stmt.executeUpdate(); stmt = connection.prepareStatement(DELETE_PARAM_CRITERIA); stmt.setString(1, funcId); stmt.executeUpdate(); stmt = connection.prepareStatement(DELETE_PARAM); stmt.setString(1, funcId); stmt.executeUpdate(); stmt = connection.prepareStatement(DELETE_PARAM_SQL); stmt.setString(1, funcId); stmt.executeUpdate(); stmt = connection.prepareStatement(DELETE_COLUMN); stmt.setString(1, funcId); stmt.executeUpdate(); stmt = connection.prepareStatement(DELETE_SQLAREA); stmt.setString(1, funcId); stmt.executeUpdate(); stmt = connection.prepareStatement(DELETE_BLOCK); stmt.setString(1, funcId); stmt.executeUpdate(); stmt = connection.prepareStatement(DELETE_FUNC); stmt.setString(1, funcId); stmt.executeUpdate(); stmt = connection.prepareStatement(DELETE_BLOCK_CHART); stmt.setString(1, funcId); stmt.executeUpdate(); stmt = connection.prepareStatement(DELETE_BLOCK_MTABLE); stmt.setString(1, funcId); stmt.executeUpdate(); stmt = connection.prepareStatement(DELETE_BLOCK_CUSTOMISE); stmt.setString(1, funcId); stmt.executeUpdate(); } }