]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/dbObjects/DomainPingConfiguration.java
fix: for the psql changes
[gigi.git] / src / org / cacert / gigi / dbObjects / DomainPingConfiguration.java
index e27b696d829cbc432a782546c19c5918135ad116..4c4931f5a13280c814d05667279a8b8fb892b3a9 100644 (file)
@@ -28,7 +28,7 @@ public class DomainPingConfiguration implements IdCachable {
     private String info;
 
     private DomainPingConfiguration(int id) {
-        GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT id, domainid, type, info FROM pingconfig WHERE id=?");
+        GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT `id`, `domainid`, `type`, `info` FROM `pingconfig` WHERE `id`=?");
         ps.setInt(1, id);
 
         GigiResultSet rs = ps.executeQuery();
@@ -69,7 +69,7 @@ public class DomainPingConfiguration implements IdCachable {
     }
 
     public Date getLastExecution() {
-        GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT `when` AS stamp from domainPinglog WHERE configId=? ORDER BY `when` DESC LIMIT 1");
+        GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT `when` AS stamp from `domainPinglog` WHERE `configId`=? ORDER BY `when` DESC LIMIT 1");
         ps.setInt(1, id);
         GigiResultSet rs = ps.executeQuery();
         if (rs.next()) {
@@ -79,7 +79,7 @@ public class DomainPingConfiguration implements IdCachable {
     }
 
     public Date getLastSuccess() {
-        GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT `when` AS stamp from domainPinglog WHERE configId=? AND state='success' ORDER BY `when` DESC LIMIT 1");
+        GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT `when` AS stamp from `domainPinglog` WHERE `configId`=? AND state='success' ORDER BY `when` DESC LIMIT 1");
         ps.setInt(1, id);
         GigiResultSet rs = ps.executeQuery();
         if (rs.next()) {
@@ -96,6 +96,6 @@ public class DomainPingConfiguration implements IdCachable {
         }
         Map<String, Object> data = new HashMap<String, Object>();
         data.put("data", new Date(lastExecution.getTime() + 5 * 60 * 1000));
-        throw new GigiApiException(new Scope(new SprintfCommand("Reping is only allowed after 5 minutes, yours end at %s.", Arrays.asList("$data")), data));
+        throw new GigiApiException(new Scope(new SprintfCommand("Reping is only allowed after 5 minutes, yours end at {0}.", Arrays.asList("${data}")), data));
     }
 }