[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [metrics-web/master] Use the ExoneraTor database for descriptor lookups.
commit fbeaeb8484cc63a78a3c77a908c143741433bbfc
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Thu Mar 22 14:55:54 2012 +0100
Use the ExoneraTor database for descriptor lookups.
---
src/org/torproject/ernie/web/ConsensusServlet.java | 4 ++--
.../ernie/web/ServerDescriptorServlet.java | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/org/torproject/ernie/web/ConsensusServlet.java b/src/org/torproject/ernie/web/ConsensusServlet.java
index 20cff07..5f642fe 100644
--- a/src/org/torproject/ernie/web/ConsensusServlet.java
+++ b/src/org/torproject/ernie/web/ConsensusServlet.java
@@ -39,7 +39,7 @@ public class ConsensusServlet extends HttpServlet {
/* Look up data source. */
try {
Context cxt = new InitialContext();
- this.ds = (DataSource) cxt.lookup("java:comp/env/jdbc/tordir");
+ this.ds = (DataSource) cxt.lookup("java:comp/env/jdbc/exonerator");
this.logger.info("Successfully looked up data source.");
} catch (NamingException e) {
this.logger.log(Level.WARNING, "Could not look up data source", e);
@@ -83,7 +83,7 @@ public class ConsensusServlet extends HttpServlet {
long requestedConnection = System.currentTimeMillis();
Connection conn = this.ds.getConnection();
Statement statement = conn.createStatement();
- String query = "SELECT rawdesc FROM consensus "
+ String query = "SELECT rawconsensus FROM consensus "
+ "WHERE validafter = '" + databaseParameter + "'";
ResultSet rs = statement.executeQuery(query);
if (rs.next()) {
diff --git a/src/org/torproject/ernie/web/ServerDescriptorServlet.java b/src/org/torproject/ernie/web/ServerDescriptorServlet.java
index d0d1f1f..5f8ba5b 100644
--- a/src/org/torproject/ernie/web/ServerDescriptorServlet.java
+++ b/src/org/torproject/ernie/web/ServerDescriptorServlet.java
@@ -41,7 +41,7 @@ public class ServerDescriptorServlet extends HttpServlet {
/* Look up data source. */
try {
Context cxt = new InitialContext();
- this.ds = (DataSource) cxt.lookup("java:comp/env/jdbc/tordir");
+ this.ds = (DataSource) cxt.lookup("java:comp/env/jdbc/exonerator");
this.logger.info("Successfully looked up data source.");
} catch (NamingException e) {
this.logger.log(Level.WARNING, "Could not look up data source", e);
@@ -78,7 +78,7 @@ public class ServerDescriptorServlet extends HttpServlet {
long requestedConnection = System.currentTimeMillis();
Connection conn = ds.getConnection();
Statement statement = conn.createStatement();
- String query = "SELECT descriptor, rawdesc FROM descriptor "
+ String query = "SELECT descriptor, rawdescriptor FROM descriptor "
+ "WHERE descriptor LIKE '" + descId + "%'";
ResultSet rs = statement.executeQuery(query);
if (rs.next()) {
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits