IGNOU BCA MCA Students - VIVA Question Answer for JAVA APPLET
JAVA APPLET or JSP Selected Question Answer - PART IX
61. Name three Component subclasses that support painting. The Canvas, Frame, Panel, and Applet classes support painting.
62. What is clipping ? Clipping is defined as the process of
confining paint operations to a limited area or shape.
63. What is the difference between a MenuItem and a
CheckboxMenuItem ? The CheckboxMenuItem class extends the MenuItem class and supports a menu item that may be either checked
or unchecked.
64. How are the elements of a BorderLayout organized ? The elements of
a BorderLayout are organized at the borders (North, South, East, and
West) and the center of a container.
65. How are the elements of a GridBagLayout organized ? The elements of
a GridBagLayout are organized according to a grid. The
elements are of different sizes and may occupy more than one row or column of
the grid. Thus, the rows and columns may have different sizes.
66. What is the difference between a Window and a Frame ? The Frame class extends the Window class and
defines a main application window that can have a menu bar.
67. What is the relationship between clipping and repainting ? When a window is
repainted by the AWT painting thread, it sets the clipping regions to the area
of the window that requires repainting.
68. What is the relationship between an event-listener interface
and an event-adapter class ? An event-listener interface defines the
methods that must be implemented by an event handler for a particular event. An
event adapter provides a default implementation of an event-listener interface.
69. How can a GUI component handle its own events ? A GUI component
can handle its own events, by implementing the corresponding event-listener
interface and adding itself as its own event listener.
70. What advantage do Java’s layout managers provide over
traditional windowing systems ? Java uses layout managers to lay out
components in a consistent manner, across all windowing platforms. Since layout
managers aren’t tied to absolute sizing and positioning, they are able to
accomodate platform-specific differences among windowing systems.
71. What is the design pattern that Java uses for all Swing
components ? The design pattern used by Java for all Swing components
is the Model View Controller (MVC) pattern.
JDBC Question Answer Starts Here
72. What is JDBC ? JDBC is an abstraction layer that allows
users to choose between databases. JDBC enables
developers to write database applications in Java, without having to
concern themselves with the underlying details of a particular database.
73. Explain the role of Driver in JDBC. The JDBC Driver
provides vendor-specific implementations of the abstract classes provided by
the JDBC API. Each driver must provide implementations for the following
classes of the java.sql package:Connection, Statement, PreparedStatement, CallableStatement, ResultSet and Driver.
74. What is the purpose Class.forName method ? This method is
used to method is used to load the driver that will establish a connection to
the database.
75. What is the advantage of PreparedStatement over Statement ? PreparedStatements
are precompiled and thus,their performance is
much better. Also, PreparedStatement objects can be reused with different
input values to their queries.
76. What is the use of CallableStatement ? Name the method,
which is used to prepare a CallableStatement.A CallableStatement is used to execute stored procedures.
Stored procedures are stored and offered by a database. Stored procedures may
take input values from the user and may return a result. The usage of stored
procedures is highly encouraged, because it offers security and modularity.The
method that prepares a CallableStatement is the following:
1
|
CallableStament.prepareCall();
|
77. What does Connection pooling mean ? The interaction
with a database can be costly, regarding the opening and closing of database
connections. Especially, when the number of database clients increases, this
cost is very high and a large number of resources is consumed.A pool of
database connections is obtained at start up by the application server and is
maintained in a pool. A request for a connection is served by a connection residing in
the pool.
In the end of the connection, the request is returned to the pool and can be
used to satisfy future requests.
No comments:
Post a Comment