56
56
import org .json .simple .JSONObject ;
57
57
import org .json .simple .parser .JSONParser ;
58
58
59
- public class PostgreSQLClient {
59
+ public class ElephantSQLClient {
60
60
61
- public PostgreSQLClient () {
61
+ public ElephantSQLClient () {
62
62
try {
63
63
createTable ();
64
64
} catch (Exception e ) {
@@ -67,9 +67,9 @@ public PostgreSQLClient() {
67
67
}
68
68
69
69
/**
70
- * Grab text from PostgreSQL
70
+ * Grab text from ElephantSQL
71
71
*
72
- * @return List of Strings of text from PostgreSQL
72
+ * @return List of Strings of text from ElephantSQL
73
73
* @throws Exception
74
74
*/
75
75
public List <String > getResults () throws Exception {
@@ -86,7 +86,7 @@ public List<String> getResults() throws Exception {
86
86
87
87
while (results .next ()) {
88
88
texts .add (results .getString ("text" ));
89
- }
89
+ }
90
90
91
91
return texts ;
92
92
} finally {
@@ -105,7 +105,7 @@ public List<String> getResults() throws Exception {
105
105
}
106
106
107
107
/**
108
- * Insert text into PostgreSQL
108
+ * Insert text into ElephantSQL
109
109
*
110
110
* param posts List of Strings of text to insert
111
111
* @return number of rows affected
@@ -149,7 +149,7 @@ public int addPosts(List<String> posts) throws Exception {
149
149
}
150
150
151
151
/**
152
- * Delete all rows from PostgreSQL
152
+ * Delete all rows from ElephantSQL
153
153
* @return number of rows affected
154
154
* @throws Exception
155
155
*/
@@ -181,7 +181,7 @@ private static Connection getConnection() throws Exception {
181
181
JSONObject vcap = (JSONObject ) parser .parse (env .get ("VCAP_SERVICES" ));
182
182
JSONObject service = null ;
183
183
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 "
185
185
for (Object key : vcap .keySet ()) {
186
186
String keyStr = (String ) key ;
187
187
if (keyStr .toLowerCase ().contains ("elephantsql" )) {
@@ -200,7 +200,7 @@ private static Connection getConnection() throws Exception {
200
200
}
201
201
}
202
202
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." );
204
204
}
205
205
206
206
/**
0 commit comments