Add update api

This commit is contained in:
2020-10-18 22:18:01 +02:00
parent c7e9cd092f
commit 2f66771b0d
2 changed files with 14 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ public class App {
private static int season; private static int season;
private static int league; private static int league;
private static String configFile; private static String configFile;
private static Logger logger = LogManager.getLogger(TeamIDMatcher.class); private static Logger logger = LogManager.getLogger(App.class);
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
initOptions(args); initOptions(args);
@@ -52,7 +52,7 @@ public class App {
} }
if(!StatusHolder.getError() && !sql.equals("")) { if(!StatusHolder.getError() && !sql.equals("")) {
TippligaSQLConnector con = new TippligaSQLConnector(); TippligaSQLConnector con = new TippligaSQLConnector();
// con.executeQuery(sql); // con.executeUpdate(sql);
} }
if(StatusHolder.getError()) { if(StatusHolder.getError()) {
System.exit(1); System.exit(1);

View File

@@ -126,9 +126,19 @@ public class TippligaSQLConnector {
try { try {
stmt = con.createStatement(); stmt = con.createStatement();
rset = stmt.executeQuery(queryString); rset = stmt.executeQuery(queryString);
} catch (SQLException throwables) { } catch (SQLException e) {
throwables.printStackTrace(); logger.error(e.getStackTrace());
} }
return rset; return rset;
} }
public void executeUpdate (String queryString){
Statement stmt;
try {
stmt = con.createStatement();
stmt.executeUpdate(queryString);
} catch (SQLException e) {
logger.error(e.getStackTrace());
}
}
} }