5656import org .json .simple .JSONObject ;
5757import org .json .simple .parser .JSONParser ;
5858
59- public class PostgreSQLClient {
59+ public class ElephantSQLClient {
6060
61- public PostgreSQLClient () {
61+ public ElephantSQLClient () {
6262 try {
6363 createTable ();
6464 } catch (Exception e ) {
@@ -67,9 +67,9 @@ public PostgreSQLClient() {
6767 }
6868
6969 /**
70- * Grab text from PostgreSQL
70+ * Grab text from ElephantSQL
7171 *
72- * @return List of Strings of text from PostgreSQL
72+ * @return List of Strings of text from ElephantSQL
7373 * @throws Exception
7474 */
7575 public List <String > getResults () throws Exception {
@@ -86,7 +86,7 @@ public List<String> getResults() throws Exception {
8686
8787 while (results .next ()) {
8888 texts .add (results .getString ("text" ));
89- }
89+ }
9090
9191 return texts ;
9292 } finally {
@@ -105,7 +105,7 @@ public List<String> getResults() throws Exception {
105105 }
106106
107107 /**
108- * Insert text into PostgreSQL
108+ * Insert text into ElephantSQL
109109 *
110110 * param posts List of Strings of text to insert
111111 * @return number of rows affected
@@ -149,7 +149,7 @@ public int addPosts(List<String> posts) throws Exception {
149149 }
150150
151151 /**
152- * Delete all rows from PostgreSQL
152+ * Delete all rows from ElephantSQL
153153 * @return number of rows affected
154154 * @throws Exception
155155 */
@@ -181,7 +181,7 @@ private static Connection getConnection() throws Exception {
181181 JSONObject vcap = (JSONObject ) parser .parse (env .get ("VCAP_SERVICES" ));
182182 JSONObject service = null ;
183183
184- // We don't know exactly what the service is called, but it will contain "postgresql "
184+ // We don't know exactly what the service is called, but it will contain "elephantsql "
185185 for (Object key : vcap .keySet ()) {
186186 String keyStr = (String ) key ;
187187 if (keyStr .toLowerCase ().contains ("elephantsql" )) {
@@ -200,7 +200,7 @@ private static Connection getConnection() throws Exception {
200200 }
201201 }
202202
203- throw new Exception ("No PostgreSQL service URL found. Make sure you have bound the correct services to your app." );
203+ throw new Exception ("No ElephantSQL service URL found. Make sure you have bound the correct services to your app." );
204204 }
205205
206206 /**
0 commit comments