Statements in JDBC

Statements in JDBC:

Statement interface:

The Statement interface offers systems to execute request with the database. The declaration interface is a creation lines of ResultSet ,it gives preparing plant procedure to get the subject of ResultSet.


Statement Methods

Prepared Statement:

The PreparedStatement interface is a sub interface of Statement. It is utilized to execute parameterized inquiry.

We should see the case of parameteriSed inquiry:

String sql=”insert into emp values(?,?,?)”;

As should be obvious, we are passing parameter (?) for the qualities. Its esteem will be set by calling the setter techniques for PreparedStatement. The execution of the application will be speedier on the off chance that you utilize PreparedStatement interface since question is accumulated just once.

JAVA Tutorial Video

 Instance of PreparedStatement:

public PreparedStatement prepareStatement(String query)throws SQLException{}

Methods of prepared Statement:

Prepare Statement

Callable Statement:

CallableStatement interface is utilized to call the put away techniques and capacities. We can have business rationale on the database by the utilization of put away methodology and capacities that will improve the execution in light of the fact that these are recompiled.

Assume you require the get the age of the representative in view of the date of birth ,you may make a capacity that gets date as the info and returns age of the worker as the yield.

Instance of CallableStatement:

public CallableStatement prepareCall(“{ call procedurename(?,?…?)}”);

example the instance of CallableStatement :

CallableStatement stmt=con.prepareCall(“{call myprocedure(?,?)}”);

Data access :

Callable Statement

 The protest of ResultSet keeps up a cursor indicating a line of a table. At first, cursor focuses to before the principal push.Be that as it may, we can make this question push ahead and reverse way by passing either TYPE_SCROLL_INSENSITIVE or TYPE_SCROLL_SENSITIVE in create Statement(int,int) technique and in addition we can make this protest as update.

Drop Us A Query

Trending Courses
  • Python and Django Online Training
  • Python is a dynamic interrupted language which is used in wide varieties of applications. It is very interactive object oriented and high-level programming language.

  • Tableau Online Training
  • Tableau is a Software company that caters interactive data visualization products that provide Business Intelligence services. The company’s Head Quarters is in Seattle, USA.

  • MicroStrategy Online Training
  • We people have been hearing the word Microstrategy over the past few years. But what is this Microstrategy? Why it’s needed? What is its advantage? Do you have all these questions

  • PEGA (PRPC) 7.3 Certification Online Training
  • Pega Systems Inc. is a Cambridge, Massachusetts based Software Company. It is known for developing software for Customer Relationship Management (CRM) and Business process Management (BPM).

  • Workday Online Training
  • Workday specialises in providing Human Capital Management, Financial Management and payroll in online domain.It is a major web based ERP software vendor.

  • Power BI Online Training
  • the need for analyzing the data is an important play major role. Because we are living in a place where we cannot find an application without big data.

100% Secure Payments. All major credit & debit cards accepted.