javajnlpdatabase-connectivity

jnlp: Reading properties file from server


I am launching application through jnlp, where i need to read the database configuration from server (Tomcat). Is it possible to connect to the host address or can i read properties file before jnlp launching the application?


Solution

  • Is it possible to connect to the host address..?

    Yes. Even a sand-boxed JWS app. can 'phone home'.

    Form an URL relative to the codebase of the application (is usually easiest). To gain the codebase, see BasicService.getCodeBase(). Here is a demo. of the BasicService (it includes source and build files).