This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Understand IntialContext

 
Costa lamona
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I don't understand at all how this code works?
it comes from this tutorial
http://java.sun.com/docs/books/tutorial/jdbc/basics/connecting.html




Thanks
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first part obtains a DataSource instance from the JNDI and gets a connection of it.

The second part doesn't compile, but its intent is to create a DataSource instance yourself, configure it yourself and finally get a connection of it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic