Archive for October, 2006

JDBC Code Examples

11 October 2006

 
Accessing Databases with JDBC

JDBC has two parts: the JDBC Core Application Programming Interface (API) and the JDBC Optional Package API.

The java.sql Package
The java.sql package provides the API for accessing and processing data in a data source. The most important members of the java.sql package are as follows:
• The DriverManager class
• The Driver interface
• The Connection […]

No Comments »

Servlets–>Notes

11 October 2006

javax.servlet.Servlet interface is very important because it encapsulates the life cycle methods of a servlet and it is the interface that all servlets must implement. “The javax.servlet Package Reference.”
The seven interfaces are as follows:
• RequestDispatcher
• Servlet
• ServletConfig
• ServletContext
• ServletRequest
• ServletResponse
• SingleThreadModel
The three classes are as follows:
• GenericServlet
• ServletInputStream
• ServletOutputStream
And, finally, the exception classes are these:
• ServletException
• UnavailableException

A Servlet’s Life Cycle
The init( ) Method
The init method is called […]

No Comments »

Core Java Interview Questions

11 October 2006

1.what is a transient variable?

A transient variable is a variable that may not be serialized.

2.which containers use a border Layout as their default layout? 

The window, Frame and Dialog classes use a border layout as their default layout.

 

3.Why do threads block on I/O? 

Threads block on i/o (that is enters the waiting state) so that other threads […]

No Comments »