Add JDBC user details to web-secure sample

See gh-1115
Remove deprecated use of Compile to work with Gradle 2.0+

The class Compile was deprecated and will be removed in Gradle 2.0 (it is
already removed in the release canidate).

Instead we should use JavaCompile. Fixes gh-1066.
Fix WS sample to use a random port