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