Here you can find the source of clearTables(Connection conn)
Parameter | Description |
---|---|
conn | Database connection |
Parameter | Description |
---|---|
Exception | into Junit |
public static void clearTables(Connection conn) throws Exception
//package com.java2s; import java.sql.Connection; import java.sql.Statement; public class Main { /**//w w w . jav a 2 s . co m * Clear the tables. * * @param conn Database connection * * @throws Exception into Junit */ public static void clearTables(Connection conn) throws Exception { Statement stmt = conn.createStatement(); try { stmt.execute("delete from id_sequences where name = 'phase'"); stmt.execute("delete from phase_dependency"); stmt.execute("delete from phase_criteria"); stmt.execute("delete from phase_criteria_type_lu"); stmt.execute("delete from project_phase"); stmt.execute("delete from phase_type_lu"); stmt.execute("delete from phase_status_lu"); stmt.execute("delete from project"); } finally { stmt.close(); } } }