Answers for "What are JDBC API Components? (Interfaces and Classes)"

1

jdbc interface

-Connection = Helps our java project
connect to database

-Statement = Helps to write and execute SQL query

-ResultSet = A DataStructure where
the data from query result stored
Posted by: Guest on January-10-2021
0

interface in jdbc

Connection = 
  Helps our java project connect to database
Statement = 
  Helps to write and execute SQL query
ResultSet = 
  A DataStructure where the data from query result stored
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    

  After succesfully created the connect
next step is STATEMENT

Statement statement = connection.createStatement();
We use createStatement() method to create
the statement from our connection.
-The result we get from this type of statement
can only move from top to bottom,
not other way around

Statement statement = connection.
createStatement(ResultSet TYPE_SCROLL_INSENSITIVE
,ResultSet CONCUR_READ_ONLY);

-The result we get from this type of
statement can freely move between rows

Once we have statement we can run
the query and get the result to
ResultSet format 
		import java.sql.ResultSet;
        
We use the method executeQuery()
to execute our queries

ResultSet result = statement.
              executeQuery("Select * from employees");
Posted by: Guest on November-28-2020

Code answers related to "What are JDBC API Components? (Interfaces and Classes)"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language