> +
> +   /**
> +    * Connects to the database using JDBC over the load balancer and 
> executes a simple query without creating a database table.
> +    * This will verify that the database engine is running on the remote 
> instance.
> +    * 
> +    * @param instance The database instance to test against
> +    * @return true if connection successful and database engine responsive
> +    * @throws TimeoutException
> +    */
> +   private boolean testDatabase(Instance instance) throws TimeoutException {
> +      System.out.println("Connect to database");
> +      
> +      // See http://dev.mysql.com/doc/refman/5.6/en/connector-j-examples.html
> +      Connection conn = null;
> +      try {
> +         StringBuilder connString = new StringBuilder();

Either way works, javac will create an implicit StringBuilder otherwise.  If 
you stick with StringBuilder, can you write it like this to avoid duplicate 
toString calls:

```
String connString = new StringBuilder()
    .append(...)
    .build();
```

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/6/files#r5328929

Reply via email to