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 league;
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 {
initOptions(args);
@@ -52,7 +52,7 @@ public class App {
}
if(!StatusHolder.getError() && !sql.equals("")) {
TippligaSQLConnector con = new TippligaSQLConnector();
// con.executeQuery(sql);
// con.executeUpdate(sql);
}
if(StatusHolder.getError()) {
System.exit(1);

View File

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