> + 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 {
> +
> + String connString = "jdbc:mysql://" +
> getVirtualIPv4(getLb().getVirtualIPs()) +
> + "/" + /* Database name */ Constants.NAME + "?user=" +
> Constants.NAME + "&password=" + Constants.PASSWORD;
> +
> + System.out.println("Connecting to " + connString);
> +
> + conn =
> + DriverManager.getConnection(connString);
> +
> + Statement stmt = null;
Exactly. I am not sure I want to do that... PS are best when used repeatedly
with variables. Here we are just checking to see if the database is working.
There is also some (small) overhead to build one.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/6/files#r4754639