From 5a516a34d78221f8f328d7af34b0ec911969e6de Mon Sep 17 00:00:00 2001 From: pair1 Date: Thu, 4 Sep 2014 14:42:14 -0400 Subject: [PATCH] Renamed Postgre to Elephant --- app/WebContent/home.jsp | 2 +- .../com/ibm/bluemix/samples/DeleteServlet.java | 2 +- ...reSQLClient.java => ElephantSQLClient.java} | 18 +++++++++--------- .../com/ibm/bluemix/samples/HomeServlet.java | 2 +- .../com/ibm/bluemix/samples/UploadServlet.java | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) rename app/src/com/ibm/bluemix/samples/{PostgreSQLClient.java => ElephantSQLClient.java} (92%) diff --git a/app/WebContent/home.jsp b/app/WebContent/home.jsp index 9046d29..7eb4862 100755 --- a/app/WebContent/home.jsp +++ b/app/WebContent/home.jsp @@ -21,7 +21,7 @@ X
-

PostgreSQL Upload

+

ElephantSQL Upload


diff --git a/app/src/com/ibm/bluemix/samples/DeleteServlet.java b/app/src/com/ibm/bluemix/samples/DeleteServlet.java index 753ea75..049302e 100755 --- a/app/src/com/ibm/bluemix/samples/DeleteServlet.java +++ b/app/src/com/ibm/bluemix/samples/DeleteServlet.java @@ -52,7 +52,7 @@ @SuppressWarnings("serial") public class DeleteServlet extends HttpServlet { - private PostgreSQLClient db = new PostgreSQLClient(); + private ElephantSQLClient db = new ElephantSQLClient(); protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("Delete Servlet"); diff --git a/app/src/com/ibm/bluemix/samples/PostgreSQLClient.java b/app/src/com/ibm/bluemix/samples/ElephantSQLClient.java similarity index 92% rename from app/src/com/ibm/bluemix/samples/PostgreSQLClient.java rename to app/src/com/ibm/bluemix/samples/ElephantSQLClient.java index d0858fc..a2deffb 100755 --- a/app/src/com/ibm/bluemix/samples/PostgreSQLClient.java +++ b/app/src/com/ibm/bluemix/samples/ElephantSQLClient.java @@ -56,9 +56,9 @@ import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; -public class PostgreSQLClient { +public class ElephantSQLClient { - public PostgreSQLClient() { + public ElephantSQLClient() { try { createTable(); } catch (Exception e) { @@ -67,9 +67,9 @@ public PostgreSQLClient() { } /** - * Grab text from PostgreSQL + * Grab text from ElephantSQL * - * @return List of Strings of text from PostgreSQL + * @return List of Strings of text from ElephantSQL * @throws Exception */ public List getResults() throws Exception { @@ -86,7 +86,7 @@ public List getResults() throws Exception { while (results.next()) { texts.add(results.getString("text")); - } + } return texts; } finally { @@ -105,7 +105,7 @@ public List getResults() throws Exception { } /** - * Insert text into PostgreSQL + * Insert text into ElephantSQL * * param posts List of Strings of text to insert * @return number of rows affected @@ -149,7 +149,7 @@ public int addPosts(List posts) throws Exception { } /** - * Delete all rows from PostgreSQL + * Delete all rows from ElephantSQL * @return number of rows affected * @throws Exception */ @@ -181,7 +181,7 @@ private static Connection getConnection() throws Exception { JSONObject vcap = (JSONObject) parser.parse(env.get("VCAP_SERVICES")); JSONObject service = null; - // We don't know exactly what the service is called, but it will contain "postgresql" + // We don't know exactly what the service is called, but it will contain "elephantsql" for (Object key : vcap.keySet()) { String keyStr = (String) key; if (keyStr.toLowerCase().contains("elephantsql")) { @@ -200,7 +200,7 @@ private static Connection getConnection() throws Exception { } } - throw new Exception("No PostgreSQL service URL found. Make sure you have bound the correct services to your app."); + throw new Exception("No ElephantSQL service URL found. Make sure you have bound the correct services to your app."); } /** diff --git a/app/src/com/ibm/bluemix/samples/HomeServlet.java b/app/src/com/ibm/bluemix/samples/HomeServlet.java index efa4b1b..de55bf2 100755 --- a/app/src/com/ibm/bluemix/samples/HomeServlet.java +++ b/app/src/com/ibm/bluemix/samples/HomeServlet.java @@ -54,7 +54,7 @@ @SuppressWarnings("serial") public class HomeServlet extends HttpServlet { - private PostgreSQLClient db = new PostgreSQLClient(); + private ElephantSQLClient db = new ElephantSQLClient(); protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("Home Servlet"); diff --git a/app/src/com/ibm/bluemix/samples/UploadServlet.java b/app/src/com/ibm/bluemix/samples/UploadServlet.java index 253578d..8920514 100755 --- a/app/src/com/ibm/bluemix/samples/UploadServlet.java +++ b/app/src/com/ibm/bluemix/samples/UploadServlet.java @@ -60,7 +60,7 @@ @SuppressWarnings("serial") public class UploadServlet extends HttpServlet { - private PostgreSQLClient db = new PostgreSQLClient(); + private ElephantSQLClient db = new ElephantSQLClient(); protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("Upload Servlet");