Servlet and JDBC Questions
Servlet and JDBC Questions
• Performance:
• Slower than C/C++: Java applications tend to be slower and consume more memory
compared to applications written in lower-level languages like C or C++ because Java
programs run on the Java Virtual Machine (JVM) which adds an additional layer of
abstraction.
•
• Memory Consumption:
• High Memory Usage: Java programs typically consume more memory because of
the JVM and garbage collection process. This can be a concern for applications that
need to run on devices with limited resources.
• Complexity:
• Verbose Syntax: Java’s syntax can be verbose and requires a lot of boilerplate code,
which can make the code less readable and harder to maintain compared to more
concise languages like Python or Ruby.
• Performance Issues:
• I/O Speed: File I/O operations can be slower compared to other types of data
operations, such as memory access, especially when dealing with large files or
numerous small file operations.
• Blocking Operations: File handling operations can block the execution of a program
while waiting for the I/O to complete, which can negatively impact performance,
particularly in applications requiring real-time processing.
• Concurrency Problems:
• File Locking: Concurrent access to files by multiple processes or threads can lead to
issues like race conditions, data corruption, or the need for complex file locking
mechanisms to ensure data integrity.
JDBC (Java Database Connectivity) is an API (Application Programming Interface) in Java that defines how a
client may access a database. It provides methods for querying and updating data in a database and is oriented
towards relational databases.
1) Import the packages 2)Load and register driver 3) Establish connection 4) create the statement and execute
the query 5) process the resultset 6)close all the jdbc connections
statement,PreparedStatement
What is a driver?
In the context of JDBC (Java Database Connectivity), a driver is a software component that facilitates
the interaction between Java applications and databases
What is a databaseURL?Explain
What is a Statement ?
What are the methods used to execute a statement?What are the returntypes?
Servlet questions
What is an API?
What is an Server?
What is an URL?
What is an servlet?
What is the method used to receive the inputs from the view files?
What is printwriter?
What is httpservlet?
What is jsp?
What is requestdispatcher?
What are methods in request dispatcher used to carry the data to nextlayer?