How to bind DataSource using context.bind. Connection pooling etc.
Joined: Aug 13, 2011
Please help me out here.
I created a simple java project in NetBean 7.0 and added jar file sqljdbc4.jar for MS SQl support.
I created a class where i have created a datasource (code below) for MQ SQL.
It connects database using the datasource and gets record count (504) successfully. (I have a Product table which has 504 records)
But it throws error when tried binding to Context. Could someone help me to suggest what should i enter to fill up the "???" in the code (red) below?
/* Bind the DataSource to JNDI so that we can look for the datasource by the name given**/
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY," ??? ");
env.put(Context.PROVIDER_URL, " ??? ");
Context ctx = new InitialContext(env);