- What makes J2EE suitable for distributed multitiered Applications?
- The J2EE platform uses a multitiered distributed application model. Application logic is divided into components according to function, and the various application components that make up a J2EE application are installed on different machines depending on the tier in the multitiered J2EE environment to which the application component belongs. The J2EE application parts are:- Client-tier components run on the client machine.
- Web-tier components run on the J2EE server.
- Business-tier components run on the J2EE server.
- Enterprise information system (EIS)-tier software runs on the EIS server.
- What is J2EE? - J2EE is an environment for developing and deploying enterprise applications. The J2EE platform consists of a set of services, application programming interfaces (APIs), and protocols that provide the functionality for developing multitiered, web-based applications.
- What are the components of J2EE application?
- A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and communicates with other components. The J2EE specification defines the following J2EE components:- Application clients and applets are client components.
- Java Servlet and JavaServer Pages technology components are web components.
- Enterprise JavaBeans components (enterprise beans) are business components.
- Resource adapter components provided by EIS and tool vendors.
- What do Enterprise JavaBeans components contain? - Enterprise JavaBeans components contains Business code, which is logic
that solves or meets the needs of a particular business domain such as banking, retail, or finance, is handled by enterprise beans running in the business tier. All the business code is contained inside an Enterprise Bean which receives data from client programs, processes it (if necessary), and sends it to the enterprise information system tier for storage. An enterprise bean also retrieves data from storage, processes it (if necessary), and sends it back to the client program. - Is J2EE application only a web-based? - No, It depends on type of application that client wants. A J2EE application can be web-based or non-web-based. if an application client executes on the client machine, it is a non-web-based J2EE application. The J2EE application can provide a way for users to handle tasks such as J2EE system or application administration. It typically has a graphical user interface created from Swing or AWT APIs, or a command-line interface. When user request, it can open an HTTP connection to establish communication with a servlet running in the web tier.
- Are JavaBeans J2EE components? - No. JavaBeans components are not considered J2EE components by the J2EE specification. They are written to manage the data flow between an application client or applet and components running on the J2EE server or between server components and a database. JavaBeans components written for the J2EE platform have instance variables and get and set methods for accessing the data in the instance variables. JavaBeans components used in this way are typically simple in design and implementation, but should conform to the naming and design conventions outlined in the JavaBeans component architecture.
- Is HTML page a web component? - No. Static HTML pages and applets are bundled with web components during application assembly, but are not considered web components by the J2EE specification. Even the server-side utility classes are not considered web components, either.
- What can be considered as a web component? - J2EE Web components can be either servlets or JSP pages. Servlets are Java programming language classes that dynamically process requests and construct responses. JSP pages are text-based documents that execute as servlets but allow a more natural approach to creating static content.
- What is the container? - Containers are the interface between a component and the low-level platform specific functionality that supports the component. Before a Web, enterprise bean, or application client component can be executed, it must be assembled into a J2EE application and deployed into its container.
- What are container services? - A container is a runtime support of a system-level entity. Containers provide components with services such as lifecycle management, security, deployment, and threading.
- What is the web container? - Servlet and JSP containers are collectively referred to as Web containers. It manages the execution of JSP page and servlet components for J2EE applications. Web components and their container run on the J2EE server.
- What is Enterprise JavaBeans (EJB) container? - It manages the execution of enterprise beans for J2EE applications.
Enterprise beans and their container run on the J2EE server. - What is Applet container? - IManages the execution of applets. Consists of a Web browser and Java Plugin running on the client together.
- How do we package J2EE components? - J2EE components are packaged separately and bundled into a J2EE application for deployment. Each component, its related files such as GIF and HTML files or server-side utility classes, and a deployment descriptor are assembled into a module and added to the J2EE application. A J2EE application is composed of one or more enterprise bean,Web, or application client component modules. The final enterprise solution can use one J2EE application or be made up of two or more J2EE applications, depending on design requirements. A J2EE application and each of its modules has its own deployment descriptor. A deployment descriptor is an XML document with an .xml extension that describes a component’s deployment settings.
- What is a thin client? - A thin client is a lightweight interface to the application that does not have such operations like query databases, execute complex business rules, or connect to legacy applications.
- What are types of J2EE clients? - Following are the types of J2EE clients:
- Applets
- Application clients
- Java Web Start-enabled rich clients, powered by Java Web Start technology.
- Wireless clients, based on Mobile Information Device Profile (MIDP) technology.
- What is deployment descriptor? - A deployment descriptor is an Extensible Markup Language (XML) text-based file with an .xml extension that describes a component’s deployment settings. A J2EE application and each of its modules has its own deployment descriptor. For example, an enterprise bean module deployment descriptor declares transaction attributes and security authorizations
for an enterprise bean. Because deployment descriptor information is declarative, it can be changed without modifying the bean source code. At run time, the J2EE server reads the deployment descriptor and acts upon the component accordingly. - What is the EAR file? - An EAR file is a standard JAR file with an .ear extension, named from Enterprise ARchive file. A J2EE application with all of its modules is delivered in EAR file.
- What is JTA and JTS? - JTA is the abbreviation for the Java Transaction API. JTS is the abbreviation for the Jave Transaction Service. JTA provides a standard interface and allows you to demarcate transactions in a manner that is independent of the transaction manager implementation. The J2EE SDK implements the transaction manager with JTS. But your code doesn’t call the JTS methods directly. Instead, it invokes the JTA methods, which then call the lower-level JTS routines. Therefore, JTA is a high level transaction interface that your application uses to control transaction. and JTS is a low level transaction interface and ejb uses behind the scenes (client code doesn’t directly interact with JTS. It is based on object transaction service(OTS) which is part of CORBA.
- What is JAXP? - JAXP stands for Java API for XML. XML is a language for representing and describing text-based data which can be read and handled by any program or tool that uses XML APIs. It provides standard services to determine the type of an arbitrary piece of data, encapsulate access to it, discover the operations available on it, and create the appropriate JavaBeans component to perform those operations.
- What is J2EE Connector? - The J2EE Connector API is used by J2EE tools vendors and system integrators to create resource adapters that support access to enterprise information systems that can be plugged into any J2EE product. Each type of database or EIS has a different resource adapter. Note: A resource adapter is a software component that allows J2EE application components to access and interact with the underlying resource manager. Because a resource adapter is specific to its resource manager, there is typically a different resource adapter for each type of database or enterprise information system.
- What is JAAP? - The Java Authentication and Authorization Service (JAAS) provides a way for a J2EE application to authenticate and authorize a specific user or group of users to run it. It is a standard Pluggable Authentication Module (PAM) framework that extends the Java 2 platform security architecture to support user-based authorization.
- What is Java Naming and Directory Service? - The JNDI provides naming and directory functionality. It provides applications with methods for performing standard directory operations, such as associating attributes with objects and searching for objects using their attributes. Using JNDI, a J2EE application can store and retrieve any type of named Java object. Because JNDI is independent of any specific implementations, applications can use JNDI to access multiple naming and directory services, including existing naming and
directory services such as LDAP, NDS, DNS, and NIS. - What is Struts? - A Web page development framework. Struts combines Java Servlets, Java Server Pages, custom tags, and message resources into a unified framework. It is a cooperative, synergistic platform, suitable for development teams, independent developers, and everyone between.
- How is the MVC design pattern used in Struts framework? - In the MVC design pattern, application flow is mediated by a central Controller. The Controller delegates requests to an appropriate handler. The handlers are tied to a Model, and each handler acts as an adapter between the request and the Model. The Model represents, or encapsulates, an application’s business logic or state. Control is usually then forwarded back through the Controller to the appropriate View. The forwarding can be determined by consulting a set of mappings, usually loaded from a database or configuration file. This provides a loose coupling between the View and Model, which can make an application significantly easier to create and maintain. Controller: Servlet controller which supplied by Struts itself; View: what you can see on the screen, a JSP page and presentation components; Model: System state and a business logic JavaBeans.
1) Explain about spring applications framework?
Spring architecture helps you to manage your business objects. Implementation part of the spring is easy because it helps you to introduce it in the middle of the objects. This framework is easy to implement in testing conditions. This is used by many large vendors.
Spring architecture helps you to manage your business objects. Implementation part of the spring is easy because it helps you to introduce it in the middle of the objects. This framework is easy to implement in testing conditions. This is used by many large vendors.
2) State some benefits and advantages of spring framework?
Some of the benefits which spring can offer you are as follows: -
• It is very beneficial for middle tier applications and it can be used in various run time environments.
• Various custom properties need not be used in applications.
• Cost can be reduced by reducing the programming to interface cost ratio.
• Applications built on spring framework are easy to test.
Some of the benefits which spring can offer you are as follows: -
• It is very beneficial for middle tier applications and it can be used in various run time environments.
• Various custom properties need not be used in applications.
• Cost can be reduced by reducing the programming to interface cost ratio.
• Applications built on spring framework are easy to test.
3) Explain about portability of spring?
Spring applications and framework are portable between different servers. This framework and applications are portable between many different servers such as Tomcat, Jetty, Web Logic, Web Sphere, Resin, Geronimo, etc. Environment features can be implemented without affecting portability.
Spring applications and framework are portable between different servers. This framework and applications are portable between many different servers such as Tomcat, Jetty, Web Logic, Web Sphere, Resin, Geronimo, etc. Environment features can be implemented without affecting portability.
4) Explain about Bean factory?
Spring is designed to work with Java Beans and this forms the core part of the Spring Framework. This is a generic factory and it lets users and developers to enable objects by name. This helps to manage relationships between objects.
Spring is designed to work with Java Beans and this forms the core part of the Spring Framework. This is a generic factory and it lets users and developers to enable objects by name. This helps to manage relationships between objects.
5) Explain about the two models of the object which Bean Factory supports?
Two models of object which bean factory supports are: -
1) Single ton and prototype.
Singleton has one instance (shared) with an object and it is assigned a specific name which can be retrieved on lookup.
Prototype results in creation of an independent object.
Two models of object which bean factory supports are: -
1) Single ton and prototype.
Singleton has one instance (shared) with an object and it is assigned a specific name which can be retrieved on lookup.
Prototype results in creation of an independent object.
6) Explain about Bean definition Reader interface?
Bean definition reader interface separates Bean factory implementations from metadata format. This is very useful if the application needs different metadata implementations. This framework or interface can be implemented in different ways.
Bean definition reader interface separates Bean factory implementations from metadata format. This is very useful if the application needs different metadata implementations. This framework or interface can be implemented in different ways.
7) State about the commonly used Bean Factory definitions?
The most commonly used bean factory definitions are as follows: -
1) XML bean factory and 2) DefaultListable beanfactory.
XMLbean factory is used to parse XML structure to define classes and properties of objects (named).
DefaultListablebeanfactory is useful to program bean factories and parse definitions.
The most commonly used bean factory definitions are as follows: -
1) XML bean factory and 2) DefaultListable beanfactory.
XMLbean factory is used to parse XML structure to define classes and properties of objects (named).
DefaultListablebeanfactory is useful to program bean factories and parse definitions.
8) Explain about inversion control behavior?
Inversion control behavior is obtained through bean factory concept. The best part about this container is it can be coded in a single line and has simple deployment steps. Inversion of control behavior is very useful to avoid heavy containers such as EJB.
Inversion control behavior is obtained through bean factory concept. The best part about this container is it can be coded in a single line and has simple deployment steps. Inversion of control behavior is very useful to avoid heavy containers such as EJB.
9) Explain about dependency injection?
Dependency injection is used to remove dependence of explicit coding on container. It resembles to a form of IoC. Java methods are chiefly used to inject dependencies into an object. It is used to collaborate and configure values into an object.
Dependency injection is used to remove dependence of explicit coding on container. It resembles to a form of IoC. Java methods are chiefly used to inject dependencies into an object. It is used to collaborate and configure values into an object.
10) Explain why an organization needs to implement spring framework?
Spring framework is essential because it touches important aspects such as
1) It is very useful to manage business objects
2) Spring architecture is very flexible it regains its architecture even when you can take some parts of it.
3) Testing part is very efficient and east to use.
4) Vendors recognized its importance and they are using it for enterprise Java development.
Spring framework is essential because it touches important aspects such as
1) It is very useful to manage business objects
2) Spring architecture is very flexible it regains its architecture even when you can take some parts of it.
3) Testing part is very efficient and east to use.
4) Vendors recognized its importance and they are using it for enterprise Java development.
11) Explain about how to deploy applications using POJOs?
Spring helps you to develop components using POJOs. Spring Framework takes care of your need to build enterprise applications. Infrastructure of your application should be away from the business logic because it can improve the pace of your business logic changes. This is provided by Springs Framework.
Spring helps you to develop components using POJOs. Spring Framework takes care of your need to build enterprise applications. Infrastructure of your application should be away from the business logic because it can improve the pace of your business logic changes. This is provided by Springs Framework.
12) Explain about auto wire support?
When auto wire is used as an optional attribute it reduces the volume of configuration. Auto wire should be used on the root element and this is used to activate auto wiring for all beans. If you would like to add an additional constructor it can be populates without the need to change configuration.
When auto wire is used as an optional attribute it reduces the volume of configuration. Auto wire should be used on the root element and this is used to activate auto wiring for all beans. If you would like to add an additional constructor it can be populates without the need to change configuration.
13) Explain the three different methods which are provided by the Namespace Handler interface?
The three different methods which are provided by the name space handler interface are: -
1) Init() is used to allow initialization for name space handler.
2) BeanDefinition parse is used when a Spring encounters a top level element.
3) BeanDefinitionHandler is used when spring encounters an attribute.
The three different methods which are provided by the name space handler interface are: -
1) Init() is used to allow initialization for name space handler.
2) BeanDefinition parse is used when a Spring encounters a top level element.
3) BeanDefinitionHandler is used when spring encounters an attribute.
14) Explain about the different ways in which Spring JDBC can help you?
There are several ways in which a spring JDBC can help you they are: -
1) Connection leaks can be avoided.
2) Code can be focused on necessary SQL and it is very low.
3) Applications will never have to depend on RDBMS error specification handling.
4) You can easily implement DAO pattern without business logic.
There are several ways in which a spring JDBC can help you they are: -
1) Connection leaks can be avoided.
2) Code can be focused on necessary SQL and it is very low.
3) Applications will never have to depend on RDBMS error specification handling.
4) You can easily implement DAO pattern without business logic.
15) Explain about exception wrapping?
Wrapping can be effectively done using spring. It makes the proprietary code to run in the ORM layer to a set of abstracted run time exceptions. Persistence exceptions can be easily handled. Handling of exceptions can be done very easily.
Wrapping can be effectively done using spring. It makes the proprietary code to run in the ORM layer to a set of abstracted run time exceptions. Persistence exceptions can be easily handled. Handling of exceptions can be done very easily.
16) Explain about transaction management in spring?
Spring uses its own abstract for transaction management. It uses to deliver
1) Programmatic transaction management through SimpleJdbcTemplate.
2) Declarative transaction management is similar to EJB. It is compatible with superset of EJB CMT with some unique features.
Spring uses its own abstract for transaction management. It uses to deliver
1) Programmatic transaction management through SimpleJdbcTemplate.
2) Declarative transaction management is similar to EJB. It is compatible with superset of EJB CMT with some unique features.
17) Explain about integration of spring with AspectJ?
Spring integrates comfortably with AspectJ and this aspect makes it very poular. It makes it possible to include AspectJ aspects into Spring applications. Using Spring IoC container it is possible for dependency inject AspectJ. AspectJ is also used to inject non spring managed POJO using spring. It is uses XML and annotation driven pointcuts.
Spring integrates comfortably with AspectJ and this aspect makes it very poular. It makes it possible to include AspectJ aspects into Spring applications. Using Spring IoC container it is possible for dependency inject AspectJ. AspectJ is also used to inject non spring managed POJO using spring. It is uses XML and annotation driven pointcuts.
Here are the Common Servlets Interview Questions.
1) Explain in detail about a servlet?
A Java servlet can be thought as an Applet but this runs on the server without the front side. This is used in applications where there is need for functionality of the web server and it is also used to access the existing business applications. It removes the limitations caused due to CGI. Servlet is platform and server independent which makes it much more popular to use.
A Java servlet can be thought as an Applet but this runs on the server without the front side. This is used in applications where there is need for functionality of the web server and it is also used to access the existing business applications. It removes the limitations caused due to CGI. Servlet is platform and server independent which makes it much more popular to use.
2) State some of the uses of Java servlet?
Java servlet is used for many purposes. Being platform and server independent it is used for wide variety of purposes. They can provide secured access to web based data. Type safety and RAD based features help in productivity. It can be used to extend the functionality present in web servers.
Java servlet is used for many purposes. Being platform and server independent it is used for wide variety of purposes. They can provide secured access to web based data. Type safety and RAD based features help in productivity. It can be used to extend the functionality present in web servers.
3) What services can be obtained by implementing Java Servlets?
These are the following services which can be obtained by using Java servlets they are: -
• Multi user services can be provided by organization using Java servlets to their clients.
• They can also serve static web pages by making use of HTTP/ (s) protocols.
• Search engines and semi custom applications can make use of servlets (web based entry, etc).
These are the following services which can be obtained by using Java servlets they are: -
• Multi user services can be provided by organization using Java servlets to their clients.
• They can also serve static web pages by making use of HTTP/ (s) protocols.
• Search engines and semi custom applications can make use of servlets (web based entry, etc).
4) Should the user or client be in the same software language in their applications?
Servlets are programmed in Java and the user need not be in the same language to access or implement the features of Servlets. They are used in middle tier which provides them a flexibility to be clients for other applications and the client who is accessing the servlet need not have the same language as the servlet.
Servlets are programmed in Java and the user need not be in the same language to access or implement the features of Servlets. They are used in middle tier which provides them a flexibility to be clients for other applications and the client who is accessing the servlet need not have the same language as the servlet.
5) Is load balancing possible with a servlet?
Load balancing is possible with the use of servlets. A servlet can forward requests to other servers which can drastically reduce load. This technique can reduce load by mirroring the same content among several servers. A single logical service can be partitioned among several servers i.e., routing according to task type.
Load balancing is possible with the use of servlets. A servlet can forward requests to other servers which can drastically reduce load. This technique can reduce load by mirroring the same content among several servers. A single logical service can be partitioned among several servers i.e., routing according to task type.
6) Explain about the service method?
Request and Response parameters are provided with the service methods. These parameters implement encapsulation; they also give access to parameters which allows them to report errors and status reports. Contrarily servlets retrieve parameters through an input stream and responses are sent through output stream.
Request and Response parameters are provided with the service methods. These parameters implement encapsulation; they also give access to parameters which allows them to report errors and status reports. Contrarily servlets retrieve parameters through an input stream and responses are sent through output stream.
7) Explain about the different usage modes present in Java servlet?
Servlets can be used in many different modes they are: -
1) Filter chains can be used to chain servlets together.
2) They can be used to support HTTP protocols.
3) They are the best replacement for CGI based applications
4) Dynamic generation of content is possible with Servlets.
Servlets can be used in many different modes they are: -
1) Filter chains can be used to chain servlets together.
2) They can be used to support HTTP protocols.
3) They are the best replacement for CGI based applications
4) Dynamic generation of content is possible with Servlets.
8) State the different ways of loading a servlet?
The different ways in which a servlet can be loaded are as follows: -
1) Dynamic loading of servlet is always possible.
2) Servers do provide an administrative option through which force loading and initialization is possible.
3) Servlets can also be loaded by Java class; they can be loaded from remote directories and local file systems.
The different ways in which a servlet can be loaded are as follows: -
1) Dynamic loading of servlet is always possible.
2) Servers do provide an administrative option through which force loading and initialization is possible.
3) Servlets can also be loaded by Java class; they can be loaded from remote directories and local file systems.
9) Explain about servlet container?
Servlet container supports servlet execution. Basic functionality of a web server and IDE of Java can be used for better performance. Specific URL`s can be translated into servlet requests. Individual servlets get them selves registered with the container and this container holds and provides information about the functionality of the servlet and the Url which can access the servlet.
Servlet container supports servlet execution. Basic functionality of a web server and IDE of Java can be used for better performance. Specific URL`s can be translated into servlet requests. Individual servlets get them selves registered with the container and this container holds and provides information about the functionality of the servlet and the Url which can access the servlet.
10) Explain about servletConfig and servletContext in applications?
Servletcontext is used to obtain application level information and only one servletcontext can be present in one application. ServletConfig object is present for every servlet and it provides initialization parameters for every servlet.
Servletcontext is used to obtain application level information and only one servletcontext can be present in one application. ServletConfig object is present for every servlet and it provides initialization parameters for every servlet.
11) Explain about Http specific servlets?
Servlets using Http protocol support Http methods which includes GET, HEAD, POST, etc. Request and response data are always provided in an MIME format. Data type is specified by the servlet and data is also written in that format which gives greater flexibility in sending output in the format requested.
Servlets using Http protocol support Http methods which includes GET, HEAD, POST, etc. Request and response data are always provided in an MIME format. Data type is specified by the servlet and data is also written in that format which gives greater flexibility in sending output in the format requested.
12) Explain about performance features of servlets?
Creation of a new process for each and every request can be avoided and this is deemed to be the biggest performance feature of servlets. Servlets run in parallel and in hand with the same process in the server. It provides greater flexibility and performance over CGI and fast CGI in an HTTP environment.
Creation of a new process for each and every request can be avoided and this is deemed to be the biggest performance feature of servlets. Servlets run in parallel and in hand with the same process in the server. It provides greater flexibility and performance over CGI and fast CGI in an HTTP environment.
13) Explain about JVM and Java servlets?
Java servlets give greater performance for leveraging Java and related internet technologies. Throughput and response time can be improved by using Java servlets. With help from JVM Java servlet programs take advantage of additional processors which will help them scale up operations from entry level servers to main frame level applications.
Java servlets give greater performance for leveraging Java and related internet technologies. Throughput and response time can be improved by using Java servlets. With help from JVM Java servlet programs take advantage of additional processors which will help them scale up operations from entry level servers to main frame level applications.
14) How does servlets handle data and give some examples of this feature?
Servlets with precoded logic process data and they return reports in an appropriate format. Some of the examples of such formats are historical graphs and tables, web data, automated forecasts, etc. Administrative data such as addition, deletion of data can be performed with Servlets.
Servlets with precoded logic process data and they return reports in an appropriate format. Some of the examples of such formats are historical graphs and tables, web data, automated forecasts, etc. Administrative data such as addition, deletion of data can be performed with Servlets.
15) What are the two different kinds of servlets used by collecting sites?
There are two kinds of servlets used by collecting sites they are used to push and pull data. One kind of servlet is used to push data to the collecting site and the other is used to pull data from the appropriate format. These formats can be clubbed with other servlets which further aggregate data and can be used for large engineering projects.
There are two kinds of servlets used by collecting sites they are used to push and pull data. One kind of servlet is used to push data to the collecting site and the other is used to pull data from the appropriate format. These formats can be clubbed with other servlets which further aggregate data and can be used for large engineering projects.
16) What are the various different input parameters which servlets accept?
There are various different iinput parameters which servlets accept they are
1) Request or an input stream from an applet or so.
2) Request of the URL
3) From different servlets or networks.
4) Parameters passed from an HTML form.
There are various different iinput parameters which servlets accept they are
1) Request or an input stream from an applet or so.
2) Request of the URL
3) From different servlets or networks.
4) Parameters passed from an HTML form.
17) Explain about the security features of Servlets?
Servlets cannot be trusted they have information about the clients. They have access to HTTP specific authentication data and peer identities can be determined. Strong security policy support is present in Java servlets. Access to network files and services needs to be restricted for a servlet. Security manager provided by Java can be used to control the level of security.
Servlets cannot be trusted they have information about the clients. They have access to HTTP specific authentication data and peer identities can be determined. Strong security policy support is present in Java servlets. Access to network files and services needs to be restricted for a servlet. Security manager provided by Java can be used to control the level of security.
1) Explain in detail about JDBC and its general features?
JDBC defines the connectivity pattern between the client and his route to database. Querying and updating method is provided in JDBC. It is primarily based on RelationalDBMS. It is a part of the Java Standard edition. JDBC classes are present in the Java package.
JDBC defines the connectivity pattern between the client and his route to database. Querying and updating method is provided in JDBC. It is primarily based on RelationalDBMS. It is a part of the Java Standard edition. JDBC classes are present in the Java package.
2) Explain about multiple implementations and drive manager?
JDBC is liberal in the usage and representation of multiple implementations in the same application. It provides a feature by which it allows loading of correct Java packages and registering them with Driver manager. A Driver manager is primarily responsible for creating JDBC connections.
JDBC is liberal in the usage and representation of multiple implementations in the same application. It provides a feature by which it allows loading of correct Java packages and registering them with Driver manager. A Driver manager is primarily responsible for creating JDBC connections.
3) What are the different types of JDBC drivers?
There are many implementations of JDBC drivers out of which some types are: -
• Drivers which implement JDBC API as mapping to another data access API.
• Drivers written in Java programming and in native code.
• Drivers which communicate with middle ware server using database independent protocol.
• Drivers which implement network protocol and are present in pure Java.
There are many implementations of JDBC drivers out of which some types are: -
• Drivers which implement JDBC API as mapping to another data access API.
• Drivers written in Java programming and in native code.
• Drivers which communicate with middle ware server using database independent protocol.
• Drivers which implement network protocol and are present in pure Java.
4) What are the different classes through which JDBC represents statements?
Statements are represented in JDBC using one of these classes: -
• Statement
• PreparedStatement
• CallableStatement
Stored procedures can also be invoked through JDBC.
Statements are represented in JDBC using one of these classes: -
• Statement
• PreparedStatement
• CallableStatement
Stored procedures can also be invoked through JDBC.
5) Explain what should be done when a SQL exception is raised?
SQL exception is raised when a data base operation fails. The chances of recovering the lost database is meager apart from logging the file with much detail one can translate the SQL exception into application domain which will eventually result in a roll back which may solve the problem to a certain extent.
SQL exception is raised when a data base operation fails. The chances of recovering the lost database is meager apart from logging the file with much detail one can translate the SQL exception into application domain which will eventually result in a roll back which may solve the problem to a certain extent.
6) Explain about the drive manager class working?
To manager a set of drivers available to JDBC a driver manager class needs to work with Driver interface. When a client requests for a specific connection by providing a URL it is the responsibility of driver manager to find a driver which can recognize that particular URL and that URL should be used for connecting to a database.
To manager a set of drivers available to JDBC a driver manager class needs to work with Driver interface. When a client requests for a specific connection by providing a URL it is the responsibility of driver manager to find a driver which can recognize that particular URL and that URL should be used for connecting to a database.
7) Why do you use a data source object for a connection?
Data source object uses a logical name for a data source and this feature increases application portability. This removes the necessity of supplying information to each and every driver. Data source can be configured manually or automatically.
Data source object uses a logical name for a data source and this feature increases application portability. This removes the necessity of supplying information to each and every driver. Data source can be configured manually or automatically.
8) State the three different ways in which you can create a table?
Tables can be created in three different ways they are: -
1) Using IDE graphical interface
2) Using ANT framework
3) JDBC SQL written into a framework.
Tables can be created in three different ways they are: -
1) Using IDE graphical interface
2) Using ANT framework
3) JDBC SQL written into a framework.
9) Explain the process of creating tables using NetBeans IDE?
Although Vendors provide specific GUI which can create tables, they can also be created using NetBeans IDE. Databases can be created either through pull-down menu or by right clicking database. Clicking on the Tables icon select BBB create table. Changes can be made to that specific table by right clicking on them.
Although Vendors provide specific GUI which can create tables, they can also be created using NetBeans IDE. Databases can be created either through pull-down menu or by right clicking database. Clicking on the Tables icon select BBB create table. Changes can be made to that specific table by right clicking on them.
10) How do you determine the sensitivity of the ResultSet object?
Sensitivity of ResultSet object is determined in three ways they are: -
1) TYPE_FORWARD_ONLY: -It contains rows which satisfied the query. These rows are satisfied either at the time of execution or as the rows are retrieved.
2) TYPE_SCROLL_INSENSITIVE: - Here the cursor can move forward backward or to an absolute position.
3) TYPE_SCROLL_SENSITIVE: - This works in the same way as the Scroll insensitive.
Sensitivity of ResultSet object is determined in three ways they are: -
1) TYPE_FORWARD_ONLY: -It contains rows which satisfied the query. These rows are satisfied either at the time of execution or as the rows are retrieved.
2) TYPE_SCROLL_INSENSITIVE: - Here the cursor can move forward backward or to an absolute position.
3) TYPE_SCROLL_SENSITIVE: - This works in the same way as the Scroll insensitive.
11) Explain about column name and getter method?
Getter methods have column names as inputs and they are case sensitive. In case a column has more than one name or similar names it considers the value of the first name and it returns search for the first name only. If columns are not explicitly named then it searches with the numbering.
Getter methods have column names as inputs and they are case sensitive. In case a column has more than one name or similar names it considers the value of the first name and it returns search for the first name only. If columns are not explicitly named then it searches with the numbering.
12) Give an example for getXXX method?
This command retrieves the value present in each column. Consider you created a table with name KAR_NAME the first column present in each row stores a value of SQL type VARCHAR. Usual method which can be used for retrieving a value of SQL type varchar or (variable character) is getstring.
This command retrieves the value present in each column. Consider you created a table with name KAR_NAME the first column present in each row stores a value of SQL type VARCHAR. Usual method which can be used for retrieving a value of SQL type varchar or (variable character) is getstring.
13) What are the methods which can verify about the cursor particular position?
In addition to these methods there are other four methods which let you verify the position of the cursor they are isFirst, isLast, isBeforeFirst, isAfterLast. All these methods return a Boolean statement which allows them to be used in a conditional statement.
In addition to these methods there are other four methods which let you verify the position of the cursor they are isFirst, isLast, isBeforeFirst, isAfterLast. All these methods return a Boolean statement which allows them to be used in a conditional statement.
14) Does JDBC support stored procedures?
Stored procedures form a logical unit which executes certain statements in a predefined format or logic. Most of the DBMS support Stored procedures. A fair amount of variation in the syntax is present. A stored procedure can be invoked from JDBC.
Stored procedures form a logical unit which executes certain statements in a predefined format or logic. Most of the DBMS support Stored procedures. A fair amount of variation in the syntax is present. A stored procedure can be invoked from JDBC.
15) Explain about Join?
Join is very important in JDBC. It joins two or more tables in the database by the commonly shared values present in them. Tables should be created and they should have a common value present in them for joining. You can precede the column name with the table name which gets you your desired table.
Join is very important in JDBC. It joins two or more tables in the database by the commonly shared values present in them. Tables should be created and they should have a common value present in them for joining. You can precede the column name with the table name which gets you your desired table.
16) Explain about the main method?
For a class to get executed it should contain static public main method. This method also allows you to invoke other methods. When we define classes we not only want other classes to follow it but it should also execute. This is the centralized idea behind main method.
For a class to get executed it should contain static public main method. This method also allows you to invoke other methods. When we define classes we not only want other classes to follow it but it should also execute. This is the centralized idea behind main method.
17) Explain about the Try Block?
Try and Catch blocks are primarily used for handling exception. Java wants a mechanism which can handle when an exception is thrown. Try block spots the exception and hands it over to catch block which process the exception and deals with it appropriately. Try block contains classes and logic inside it.
Try and Catch blocks are primarily used for handling exception. Java wants a mechanism which can handle when an exception is thrown. Try block spots the exception and hands it over to catch block which process the exception and deals with it appropriately. Try block contains classes and logic inside it.
1) Explain and detail about Java patterns?
Patterns are very useful programming technique to a programmer. They tend to make solutions easier by creating a design pattern which can be used by a different developer other than the creator. They function as problem solving documentation. Solutions offered by Java Patterns are very practical rather than theoretical.
Patterns are very useful programming technique to a programmer. They tend to make solutions easier by creating a design pattern which can be used by a different developer other than the creator. They function as problem solving documentation. Solutions offered by Java Patterns are very practical rather than theoretical.
2) Describe some of the uses of patterns (Java)?
Java patterns are used for many purposes some of them are: -
1) It describes about the problem and its solution in detail.
2) Solving a common problem becomes easy because of predefined solutions from other programmers and developers.
3) They describe practical problems rather than theoretical problems they are very useful in the real world.
4) Time utilization and productivity is greater due to the usage of Java patterns.
Java patterns are used for many purposes some of them are: -
1) It describes about the problem and its solution in detail.
2) Solving a common problem becomes easy because of predefined solutions from other programmers and developers.
3) They describe practical problems rather than theoretical problems they are very useful in the real world.
4) Time utilization and productivity is greater due to the usage of Java patterns.
3) What are the contexts in which Patterns can be used?
Java patterns are used in these scenarios they are: -
• Giving solutions to recurring problems.
• Practical solutions to real world problems rather than theoretical solutions.
• It can also be used to document real world solutions to a particular problem.
• It can work really well for given concern or trade offs.
Java patterns are used in these scenarios they are: -
• Giving solutions to recurring problems.
• Practical solutions to real world problems rather than theoretical solutions.
• It can also be used to document real world solutions to a particular problem.
• It can work really well for given concern or trade offs.
4) Explain about the concept of Generative in Patterns?
Patterns are used to detail about a problem and its solution but is should not be restricted at that point it should also include about the difficulty of the problem, solution addressing all the concerns, constraints of all sorts, etc. It should include everything which revolves around the Generative solution to a problem.
Patterns are used to detail about a problem and its solution but is should not be restricted at that point it should also include about the difficulty of the problem, solution addressing all the concerns, constraints of all sorts, etc. It should include everything which revolves around the Generative solution to a problem.
5) State some of the elements present in Canonical pattern?
There are very few patterns which are used by developers and programmers they are Gang of four patterns, Canonical form or pattern and Alexandrian form. Some of the elements present in patterns are Problem, name, aliases, context, forces, solution, examples, resulting context, rationale, related patterns, uses, etc.
There are very few patterns which are used by developers and programmers they are Gang of four patterns, Canonical form or pattern and Alexandrian form. Some of the elements present in patterns are Problem, name, aliases, context, forces, solution, examples, resulting context, rationale, related patterns, uses, etc.
6) Explain about abstract factory method?
Abstract factory pattern is used to create instances of abstract classes from a matched set of concrete sub classes. This pattern allows a developer to use various complex technologies such as windowing systems with similar characteristics and functionality. It basically creates abstract classes.
Abstract factory pattern is used to create instances of abstract classes from a matched set of concrete sub classes. This pattern allows a developer to use various complex technologies such as windowing systems with similar characteristics and functionality. It basically creates abstract classes.
7) Explain the difference between Canonical and GoF form?
Canonical and GoF patterns are almost similar in characteristics. Canonical form places greater importance on explicit forces and resolutions whereas in GoF format a solution is broken into different sections and it also uses design diagrams with sample code.
Canonical and GoF patterns are almost similar in characteristics. Canonical form places greater importance on explicit forces and resolutions whereas in GoF format a solution is broken into different sections and it also uses design diagrams with sample code.
8) State the purpose of why a Java singleton should be used?
Java singleton is used when a constructor and finalize methods are used only once during the lifetime of the application. If a class is referenced from within then it is garbage collected by the Java which can be retrieved if called again but the problem comes when the constructor or finalize methods are used only once.
Java singleton is used when a constructor and finalize methods are used only once during the lifetime of the application. If a class is referenced from within then it is garbage collected by the Java which can be retrieved if called again but the problem comes when the constructor or finalize methods are used only once.
9) Explain about state dependence?
State dependence tells you about the action performed on the object whether succeeded or failed, action which can be performed, monitoring methods, postponing, triggering, preventing, etc. This is also used to monitor methods.
State dependence tells you about the action performed on the object whether succeeded or failed, action which can be performed, monitoring methods, postponing, triggering, preventing, etc. This is also used to monitor methods.
10) Explain about particle canvas?
Particle canvas is a sub class of java.awt. Canvas this class provides a drawing area for all the particles. Whenever a paint method is called it invokes draw for all the existing particles. It cannot create object or particles by itself. Existing particle objects are stored in the array of instance variable particles.
Particle canvas is a sub class of java.awt. Canvas this class provides a drawing area for all the particles. Whenever a paint method is called it invokes draw for all the existing particles. It cannot create object or particles by itself. Existing particle objects are stored in the array of instance variable particles.
11) Explain about closed subsystems?
In a closed system a developer will have a perfect knowledge about all the possible behaviors and static design time. By employing encapsulation techniques one can close parts of the system. This is possible in product level components and the lower rung of individual classes.
In a closed system a developer will have a perfect knowledge about all the possible behaviors and static design time. By employing encapsulation techniques one can close parts of the system. This is possible in product level components and the lower rung of individual classes.
12) Explain about open systems?
Open systems are used widely by developers than the closed systems because these are attainable and achievable. It can be accessed across several dimensions. Full static analysis is not possible because of their nature and structural evolution which varies according to time. Open systems may load classes dynamically, can employ call backs, resource sharing, etc.
Open systems are used widely by developers than the closed systems because these are attainable and achievable. It can be accessed across several dimensions. Full static analysis is not possible because of their nature and structural evolution which varies according to time. Open systems may load classes dynamically, can employ call backs, resource sharing, etc.
13) Explain about fully synchronized objects?
In a fully synchronized object all methods are synchronized. Encapsulation violations are generally neglected. Methods are finite which release locks. Even in the presence of exceptions state of the object is at the beginning and end of each method.
In a fully synchronized object all methods are synchronized. Encapsulation violations are generally neglected. Methods are finite which release locks. Even in the presence of exceptions state of the object is at the beginning and end of each method.
14) Explain about locks?
Lock is known to be the safest and the basic message control mechanism used in object oriented mechanism. This is used to block the usage of methods while another method is in progress. The only safest way to use lock mechanism is to fully synchronized objects.
Lock is known to be the safest and the basic message control mechanism used in object oriented mechanism. This is used to block the usage of methods while another method is in progress. The only safest way to use lock mechanism is to fully synchronized objects.
15) Explain about semaphores?
They are mostly used as concurrency control constructs. They adhere and support Sync interface and conform to acquire release protocol. It adheres to a set of permits initialized in a constructor. A semaphore can also be described on the basis of a metaphor.
They are mostly used as concurrency control constructs. They adhere and support Sync interface and conform to acquire release protocol. It adheres to a set of permits initialized in a constructor. A semaphore can also be described on the basis of a metaphor.
16) Explain about Template method?
Template method is the most common way of representing. Implementation of a method differs for files, sockets, pipes, strings, text entry widgets, etc. When template method is used logic of the entire class is modified. Missing logic can be called by abstract and concrete methods.
Template method is the most common way of representing. Implementation of a method differs for files, sockets, pipes, strings, text entry widgets, etc. When template method is used logic of the entire class is modified. Missing logic can be called by abstract and concrete methods.
17) State all the different patterns and give the various divisions present?
There are various different patterns and they can be divided into these patterns they are: -
1) Fundamental design patterns
2) Creational patterns
3) Partitioning patterns
4) Structural patterns
5) Behavioral patterns
6) Concurrency patterns
Delegation, Interface, Immutable, Proxy and marker interface are some of the sub divisions present in Fundamental interface.
There are various different patterns and they can be divided into these patterns they are: -
1) Fundamental design patterns
2) Creational patterns
3) Partitioning patterns
4) Structural patterns
5) Behavioral patterns
6) Concurrency patterns
Delegation, Interface, Immutable, Proxy and marker interface are some of the sub divisions present in Fundamental interface.