title: how to create initialcontext to connect to sql server
body: <p>I am having difficulty connecting my java code to sql server database.  I can connect from App server just fine..but now I want to try to connect with app server out of the picture and using <code>InitialContext</code> with some env properties. So a stand alone java class connecting to sql server using <code>InitialContext</code></p>
  
  <p>I have mssqlserver.jar in my projects libraries. Do I need some other jar as well?</p>
  
  <p>I looked around for some code sample but dont know what to put in <code>Context.INITIAL_CONTEXT_FACTORY</code></p>
  
  <pre><code>Hashtable env = new Hashtable();
  env.put(Context.INITIAL_CONTEXT_FACTORY, "what do i put here?");
  env.put("java.naming.factory.initial",
  "what do i put here?");
  ...
  what other properties would I need?
  </code></pre>
  
  <p>on the App server I have following properties. </p>
  
  <pre><code>datasourceName = mydb
  user = myuser
  port = 1433
  password = mypwd
  databaseName = mydb
  servername = localhost
  </code></pre>