Skip to content

Commit 45119fb

Browse files
committed
Address rest of lesv's feedback.
1 parent ae1b616 commit 45119fb

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

cloud-sql/mysql/servlet/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
## Before you begin
44

55
1. If you haven't already, set up a Java Development Environment (including google-cloud-sdk and
6-
maven utilities) by following the [java setup guide](https://cloud.google.com/java/docs/setup).
6+
maven utilities) by following the [java setup guide](https://cloud.google.com/java/docs/setup) and
7+
[create a project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project).
78

89
1. Create a 2nd Gen Cloud SQL Instance by following these
910
[instructions](https://cloud.google.com/sql/docs/mysql/create-instance). Note the connection string,
@@ -25,6 +26,8 @@ export DB_USER='my-db-user'
2526
export DB_PASS='my-db-pass'
2627
export DB_NAME='my_db'
2728
```
29+
Note: Saving credentials in environment variables is convenient, but not secure - consider a more
30+
secure solution such as [Cloud KMS](https://cloud.google.com/kms/) to help keep secrets safe.
2831

2932
## Deploying locally
3033

@@ -40,7 +43,9 @@ Navigate towards `http://127.0.0.1:8080` to verify your application is running c
4043

4144
To run on GAE-Standard, create an AppEngine project by following the setup for these
4245
[instructions](https://cloud.google.com/appengine/docs/standard/java/quickstart#before-you-begin)
43-
and verify that `appengine-api-1.0-sdk` is listed as a dependency in the pom.xml.
46+
and verify that
47+
[appengine-maven-plugin](https://cloud.google.com/java/docs/setup#optional_install_maven_or_gradle_plugin_for_app_engine)
48+
has been added in your build section as a plugin.
4449

4550

4651
### Development Server

cloud-sql/mysql/servlet/src/main/java/com/example/cloudsql/ConnectionPoolContextListener.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
@WebListener("Creates a connection pool that is stored in the Servlet's context for later use.")
3030
public class ConnectionPoolContextListener implements ServletContextListener {
3131

32+
// Saving credentials in environment variables is convenient, but not secure - consider a more
33+
// secure solution such as https://cloud.google.com/kms/ to help keep secrets safe.
3234
private static final String CLOUD_SQL_INSTANCE_NAME = System.getenv("CLOUD_SQL_INSTANCE_NAME");
3335
private static final String DB_USER = System.getenv("DB_USER");
3436
private static final String DB_PASS = System.getenv("DB_PASS");

0 commit comments

Comments
 (0)