https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.3/html/how_to_configure_server_security/securely_storing_credentials
@Resource
Environment env;
env.getRequiredProperty(“jndiname”); // get the jndi from cloud property file in case of cannot put the jndi in the jar file.
JndiDataSourceLookup lookup = new JndiDataSourceLookup ()
lookup.getDataSource(“jndiname”)
//jdbc get connection
DataSourceBuilder.create().build();