All Question paper with solution mean Bachelorexam.com

(Aktu Btech ) Web Technology Important Unit-4 Enterprise Java Beans and JDBC

With the help of Aktu Btech Quantum Notes, you can better comprehend web technology. You can improve your exam preparation by reviewing these helpful frequently asked questions. Begin immediately on the path to success! Unit-4 Enterprise Java Beans and JDBC

Dudes 🤔.. You want more useful details regarding this subject. Please keep in mind this as well.

Important Questions For Web Technology:
*Quantum               *B.tech-Syllabus
*Circulars                *B.tech AKTU RESULT
* Btech 3rd Year     * Aktu Solved Question Paper

Q1. What is EJB? Write the advantages and disadvantages of EJB. 

Ans.

  • 1. An Enterprise Java Bean is a server-side element that incorporates business logic.
  • 2. Scalable, reliable, and secure corporate Java applications are created using EJB (Enterprise Java Bean).
  • 3. The EJB container offers middleware features like security, transaction management, etc. to all EJB applications.
  • 4. We require an application server (EJB Container) to run EJB applications, such as Jboss, Glassfish, Weblogic, Websphere, etc.
  • 5. Because EJB applications are installed on servers, they are sometimes referred to as server-side components.

Advantages of EJB: 

  • 1. It can run in multithreaded environment. 
  • 2. It contains only business logic. 
  • 3. EJB provides distributed transaction support.
  • 4. It provides portable and scalable solutions of the problem.
  • 5. It provides a mechanism to store and retrieve data in a persistent way.  

Disadvantages of EJB: 

  • 1. It requires application server. 
  • 2 It requires only Java client. For other language client, we need to go web for service. 
  • 3. It is complex to understand and develop EJB applications. 

Q2. Explain session beans with its types. 

Ans. Session bean: 

  • 1. Session beans can be used by local, remote, and web service clients and simply contain business logic.
  • 2. It can be used to control operations like calculation and database access.
  • 3. The application server maintains the session bean’s life cycle (EJB container).
  • 4. A customer creates a session bean, and it is only valid for the signal client server session.

Types of session bean: 

1. Stateless session bean: 

  • a. A business object that just represents business logic is a stateless session bean. There is no state there (data).
  • b. The EJB container pools the stateless bean objects to handle the request as it comes in.
  • c. Just one client at a time can access it.
  • d. A distributed object with no relationship to informal state, the stateless session bean merely permits parallel access to beans.
  • e. Annotations used in stateless session bean are:
    • i. @Stateless 
    • ii. @Post Construct 
    • iii. @PreDestroy   

2. Stateful session bean: 

  • a. Stateful session beans, like stateless session beans, are business objects that represent business logic. Yet, it keeps state (data).
  • b. The container in a stateful session bean keeps track of the conversational state between numerous method calls.
  • c. There are five important annotations used in stateful session bean:
    • i. Stateful 
    • ii. @PostConstruct 
    • iii. @PreDestroy 
    • iv. @PrePassivate 
    • v.@PostActivate

3. Singleton session beans:

  • a. A singleton session bean is instantiated once per application and exists for the lifecycle of the application. 
  • b. Singleton session beans are designed for circumstances in which a single enterprise bean instance is shared across and concurrently accessed by clients. 
  • c. It has only one singleton session bean per application.  
  • d. It can implement web service endpoints.
  • e. Singleton session beans maintain their state between client invocations but are not required to maintain their state across server crashes or shutdowns.  

Q3. Explain transaction management in JDBC. What are the types of transaction ? 

Ans.

  • 1. A transaction is a group of operation used to perform single task.
  • 2. If all operations in the group are successful then the task is finished and the transaction is successfully completed.
  • 3. If any one operation in the group is failed then the task is failed and the transaction is failed. 
Explain transaction management in JDBC. What are the types of transaction ? Web Technology

Types of transaction: 

  • 1. Local transaction: A local transaction means that all operations ina transaction are executed against one database.
  • For example: If we transfer money from first account to second account and both accounts belongs to same bank then transaction is local transaction. 
  • 2. Global transaction: A global transaction means that all operations in a transaction are executed against multiple databases. 
  • For example: If we transfer money from first account to second account belongs to different banks then the transaction is a global transaction. 

Q4. Write a short note on stored procedure in Java. 

Ans. 1. A program which contains n number of SQL statements and residing a database environment is known as stored procedure. 

2. Stored procedures are divided into two types:

a. Procedure:

i. A procedure is one which contains block of statements which will return either zero or more than one value.

ii. Syntax for creating a procedure: 

Write a short note on stored procedure in Java. Web Technology

b. Function: 

i. A function is one which contains n number of block of statements to perform some operation and it returns a single value only.

ii. Syntax for creating a function : 

Write a short note on stored procedure in Java. 

Q5. Explain PreparedStatement interface in JDBC.  

Ans.

  • 1. Prepared statement interface is a subinterface of statement. 
  • 2. It is used to execute parameterized query. 
  • 3. The PreparedStatement interfaces define the methods and properties that enable us to send sQL or PLsQL commands and receive data from our database.
  • 4. This statement gives us the flexibility for supplying arguments dynamically.
  • 5. Syntax to create PreparedStatement object:
Explain PreparedStatement interface in JDBC. Web Technology
Explain PreparedStatement interface in JDBC. Aktu Btech
  • 6. All parameters in JDBC are represented by the ? symbol, which is known as the parameter marker. We must supply values for every parameter before executing the SQL statement. 
  • 7. To close the PreparedStatement object a simple call to the closel) method is made. If we close the connection object first, it will close the PreparedStatement object as well.

Q6. Explain the types of JDBC drivers.

Ans. Types of JDBC drivers are: 

  • 1. JDBC-ODBC bridge driver (Type 1 driver): 
    • a. These drivers are the bridge drivers such as JDBC-ODBC bridge. 
    • b. These drivers rely on an intermediary such as ODBC to transfer the SQL calls to the database.
    • c. Bridge drivers often rely on native code, although the JDBC-ODBC library native code is part of the Java-2 virtual machine.
Explain the types of JDBC drivers. Web Technology
  • 2. Native API partly Java driver (Type 2 driver):
    • a. A native API is partly a Java driver. It uses native C language library calls to translate JDBC to native client library.
    • b. These drivers are available for Oracle, Sybase, DB2 and other client library based RDBMS.
    • c. Type 2 drivers use native code and require additional permission to work in an Applet. 
    • d. A Type 2 driver might need client-side database code to connect over the network.
Explain the types of JDBC drivers. Aktu Btech
  • 3. JDBC net pure Java driver (Type 3 driver): 
    • a. JDBCnet pure Java driver consists of JDBC and DBMS independent protocol driver.
    • b. Here the calls are translated and sent to middle tier server through the socket. 
    • c. The middle tier contacts the database. 
    • d. Type 3 drivers call the database API on the server.
  • 4. Native protocol pure Java driver (Type 4 driver): 
    • a. A native protocol Java driver contains JDBC calls that are converted directly to the network protocol used by the DBMS server. 
    • b. This driver interacts directly with database.   
Explain the types of JDBC drivers.
  • c. It does not require any native database library. So, it is also called thin driver. 
bachelor exam preparation all question paper with solution important questions with solution

Web Technology Btech Quantum PDF, Syllabus, Important Questions

LabelLink
Subject SyllabusSyllabus
Short QuestionsShort-question
Question paper – 2021-222021-22

Web Technology Quantum PDF | AKTU Quantum PDF:

Quantum SeriesLinks
Quantum -2022-232022-23

AKTU Important Links | Btech Syllabus

Link NameLinks
Btech AKTU CircularsLinks
Btech AKTU SyllabusLinks
Btech AKTU Student DashboardStudent Dashboard
AKTU RESULT (One VIew)Student Result

Important Links-Btech (AKTU)

LabelLinks
Btech InformationInfo Link
Btech BranchLINK
Quantum-PageLink

Leave a Comment