Add update api
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user