Skip to content

Commit 9867405

Browse files
committed
Moved DROP TABLE statement inside try-catch block
1 parent 26d7f5b commit 9867405

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

src/test/java/com/ffxivcensus/gatherer/GathererControllerTest.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,24 @@ public class GathererControllerTest {
5353
public static void setUpBaseClass(){
5454
try {
5555
readConfig();
56+
String strSQL = "DROP TABLE tblplayers;";
57+
java.sql.Connection conn = openConnection();
58+
try {
59+
Statement stmt = conn.createStatement();
60+
stmt.executeUpdate(strSQL);
61+
} catch (SQLException e) {
62+
System.out.println("Error executing SQL statement to DROP TABLE");
63+
}
64+
closeConnection(conn);
65+
5666
} catch (ParserConfigurationException e) {
5767
e.printStackTrace();
5868
} catch (IOException e) {
5969
e.printStackTrace();
6070
} catch (SAXException e) {
6171
e.printStackTrace();
6272
}
63-
String strSQL = "DROP TABLE tblplayers;";
64-
java.sql.Connection conn = openConnection();
65-
try {
66-
Statement stmt = conn.createStatement();
67-
stmt.executeUpdate(strSQL);
68-
} catch (SQLException e) {
69-
System.out.println("Error executing SQL statement to DROP TABLE");
70-
}
71-
closeConnection(conn);
73+
7274
}
7375

7476
/**

0 commit comments

Comments
 (0)