File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Understand IntialContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Understand IntialContext" Watch "Understand IntialContext" New topic
Author

Understand IntialContext

Costa lamona
Ranch Hand

Joined: Sep 24, 2006
Posts: 102
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


SCJP 5
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Understand IntialContext