Skip to content

Commit

Permalink
Renamed Postgre to Elephant
Browse files Browse the repository at this point in the history
  • Loading branch information
pair1 committed Sep 4, 2014
1 parent bbf8c80 commit 5a516a3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/WebContent/home.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<a href="/delete" class="btn btn-danger" title="Clear All">X</a>
</div>
<div class="text-center">
<h1><a href="/">PostgreSQL Upload</a></h1>
<h1><a href="/">ElephantSQL Upload</a></h1>
<p>
<form action="/upload" method="POST" enctype="multipart/form-data">
<input type="file" name="file" /><br>
Expand Down
2 changes: 1 addition & 1 deletion app/src/com/ibm/bluemix/samples/DeleteServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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<String> getResults() throws Exception {
Expand All @@ -86,7 +86,7 @@ public List<String> getResults() throws Exception {

while (results.next()) {
texts.add(results.getString("text"));
}
}

return texts;
} finally {
Expand All @@ -105,7 +105,7 @@ public List<String> 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
Expand Down Expand Up @@ -149,7 +149,7 @@ public int addPosts(List<String> posts) throws Exception {
}

/**
* Delete all rows from PostgreSQL
* Delete all rows from ElephantSQL
* @return number of rows affected
* @throws Exception
*/
Expand Down Expand Up @@ -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")) {
Expand All @@ -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.");
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/src/com/ibm/bluemix/samples/HomeServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion app/src/com/ibm/bluemix/samples/UploadServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 5a516a3

Please sign in to comment.