You could get some guidance by going into JDeveloper and on a java class type bc4jclient and ALT + Enter and you can get the general structure to create a client that access the BC layer. As a general rule of thumb you should not input the DB credentials directly the DB connection is handled by the AM itself.

Perhaps, somthing like this can illustrate what you are trying to implement:
http://techiecook.wordpress.com/2010/10/08/creating-root-application-module-instance-oracle-adf/ and here http://docs.oracle.com/cd/E23943_01/web.1111/b31974/bcservices.htm#CHDDDBFC

When I run the standalone java class from jDeveloper 11.1.1.5.0, I am able to get application module and also able to get the out put from application module method. While running the java class jdev is exectung the class with javaw command. I tried to execute the same from commnd prompt, it didn't print anything on the command prompt. So I tried to execute java command with "java followed by class path" as below.

set JAVA_HOME=C:\Oracle\Middleware\jdk160_24\jre
set PATH=%JAVA_HOME%\bin;%PATH%
java -classpath E:\poc\TestBatchJobClient\Project1\deploy\First.jar;E:\poc\BatchJobApp\Model\deploy\adf-share-base.jar;E:\poc\BatchJobApp\Model\deploy\adfm.jar;E:\poc\BatchJobApp\Model\deploy\BatchJobApp_Model.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share_11.1.1\adf-share-support.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share.ca_11.1.1\adf-share-ca.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share.ca_11.1.1\adf-share-base.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share_11.1.1\adflogginghandler.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share_11.1.1\adfsharembean.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jmx_11.1.1\jmxframework.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jmx_11.1.1\jmxspi.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.idm_11.1.1\identitystore.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.model_11.1.1\adfm.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.model_11.1.1\bc4j-mbeans.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.model_11.1.1\bc4jwizard.jar;C:\Oracle\Middleware\oracle_common\modules\groovy-all-1.6.3.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.model_11.1.1\db-ca.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.model_11.1.1\jdev-cm.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.ldap_11.1.1\ojmisc.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share_11.1.1\commons-el.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share_11.1.1\jsp-el-api.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.share_11.1.1\oracle-el.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.javatools_11.1.1\resourcebundle.jar;C:\Oracle\Middleware\modules\javax.activation_1.1.0.0_1-1.jar;C:\Oracle\Middleware\modules\javax.mail_1.1.0.0_1-4-1.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.mds_11.1.1\oramds.jar;C:\Oracle\Middleware\modules\javax.servlet_1.0.0.0_2-5.jar;C:\Oracle\Middleware\modules\javax.jsp_1.2.0.0_2-1.jar;C:\Oracle\Middleware\jdeveloper\ide\macros\..\..\..\wlserver_10.3\server\lib\ojdbc6.jar;C:\Oracle\Middleware\oracle_common\jlib\commons-cli-1.0.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.bali.share_11.1.1\share.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.xmlef_11.1.1\xmlef.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.dms_11.1.1\dms.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.javacache_11.1.1\cache.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.ucp_11.1.0.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.odl_11.1.1\ojdl.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.javatools_11.1.1\javatools-nodeps.jar;C:\Oracle\Middleware\modules\javax.management_1.2.1.jar;C:\Oracle\Middleware\modules\javax.management.j2ee_1.0.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.mds_11.1.1\mdsrt.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.ldap_11.1.1\ldapjclnt11.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jps_11.1.1\jps-api.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jps_11.1.1\jps-common.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jps_11.1.1\jps-ee.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jps_11.1.1\jps-internal.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jps_11.1.1\jps-unsupported-api.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jps_11.1.1\jps-manifest.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.jps_11.1.1\jacc-spi.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.pki_11.1.1\oraclepki.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.osdt_11.1.1\osdt_core.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.osdt_11.1.1\osdt_cert.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.osdt_11.1.1\osdt_xmlsec.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.osdt_11.1.1\osdt_ws_sx.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.iau_11.1.1\fmw_audit.jar;C:\Oracle\Middleware\modules\javax.security.jacc_1.0.0.0_1-1.jar;C:\Oracle\Middleware\oracle_common\modules\oracle.adf.security_11.1.1\adf-share-security.jar -Djavax.net.ssl.trustStore=C:\Oracle\Middleware\wlserver_10.3\server\lib\DemoTrust.jks com.org.TestMyClass
{code}
I got the same old error.
Regards,
Satya

Apr 20, 2013 4:20:56 PM oracle.adf.share.ADFContext getCurrent
WARNING: Automatically initializing a DefaultContext for getCurrent.
Caller should ensure that a DefaultContext is proper for this use.
Memory leaks and/or unexpected behaviour may occur if the automatic initialization is performed improperly.
This message may be avoided by performing initADFContext before using getCurrent().
To see the stack trace for thread that is initializing this, set the logging level of oracle.adf.share.ADFContext to FINEST
Apr 20, 2013 4:20:56 PM oracle.security.jps.internal.config.xml.XmlConfigurationFactory initDefaultConfiguration
SEVERE: java.io.FileNotFoundException: C:\Users\sb38018\.\config\jps-config.xml (The system cannot find the path specified)
Apr 20, 2013 4:20:58 PM oracle.adf.share.jndi.MDSBackingStore documentExists
INFO: MDS-00013: no metadata found for metadata object "/META-INF/connections.xml"
Exception in thread "main" oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.ConfigException, msg
=JBO-33003: Connection name localDb is not defined.
at oracle.jbo.common.ampool.PoolMgr.findPool(PoolMgr.java:529)
at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1505)
at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1482)
at com.org.TestMyClass.main(TestMyClass.java:57)
Caused by: oracle.jbo.ConfigException: JBO-33003: Connection name localDb is not defined.
at oracle.jbo.client.Configuration.initializeFromConnectionName(Configuration.java:1199)
at oracle.jbo.client.Configuration.getConfiguration(Configuration.java:648)
at oracle.jbo.common.ampool.PoolMgr.loadConfiguration(PoolMgr.java:605)
at oracle.jbo.common.ampool.PoolMgr.findPool(PoolMgr.java:526)
... 3 more
## Detail 0 ##
oracle.jbo.ConfigException: JBO-33003: Connection name localDb is not defined.
at oracle.jbo.client.Configuration.initializeFromConnectionName(Configuration.java:1199)
at oracle.jbo.client.Configuration.getConfiguration(Configuration.java:648)
at oracle.jbo.common.ampool.PoolMgr.loadConfiguration(PoolMgr.java:605)
at oracle.jbo.common.ampool.PoolMgr.findPool(PoolMgr.java:526)
at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1505)
at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1482)
at com.org.TestMyClass.main(TestMyClass.java:57)
{code}
Please advice.
I am able to connect using otherway, as I mentioned in my very first post of the thread. Is it a good practise?
Thanks,
Satya