What is a Stored Procedure? How to Call Stored Procedure Using JDBC API

Stored procedure is a group of SQL statements that forms a logical unit and performs a particular task. Stored Procedures are used to encapsulate a set of operations or queries to execute on database. Stored procedures can be compiled and executed with different parameters and results and may have any combination of input/output parameters. Stored … Read more

What Are The Types of Statements in JDBC

the JDBC API has 3 Interfaces, (1. Statement, 2. PreparedStatement, 3. CallableStatement ). The key features of these are as follows: Statement This interface is used for executing a static SQL statement and returning the results it produces. The object of Statement class can be created using Connection.createStatement() method. PreparedStatement A SQL statement is pre-compiled and … Read more

Explain Modifier Final

: Final can be applied to classes, methods and variables and the features cannot be changed. Final class cannot be subclassed, methods cannot be overridden. In Java, the final modifier is used to apply restrictions on classes, methods, and variables. Here’s a brief explanation of its usage in different contexts: Final Variables: When applied to … Read more

Is it Legal For The Extending Class Which Overrides a Method Which Throws an Exception, not o Throw in the Overridden Class

Yes it is perfectly legal. In Java, when a subclass overrides a method from its superclass, it must adhere to certain rules regarding the exceptions it throws. The overriding method in the subclass cannot throw checked exceptions that are broader than the ones thrown by the overridden method in the superclass. However, it is allowed … Read more

How Will You Handle The Checked Exceptions ?

  : You can provide a try/catch block to handle it. OR Make sure method declaration includes a throws clause that informs the calling method an exception might be thrown from this particular method When you extend a class and override a method, can this new method throw exceptions other than those that were declared … Read more