0% found this document useful (0 votes)
11 views47 pages

Day 15

The document outlines the curriculum for the Advanced Java course at the Domain Summer Winning Camp 2024, focusing on CRUD operations using databases. It covers prerequisites, objectives, outcomes, and detailed explanations of JDBC, including its types of drivers and methods for database connectivity. Additionally, it provides examples of using JDBC interfaces such as Connection, Statement, and PreparedStatement for executing SQL queries in Java applications.

Uploaded by

ashishyogi051
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views47 pages

Day 15

The document outlines the curriculum for the Advanced Java course at the Domain Summer Winning Camp 2024, focusing on CRUD operations using databases. It covers prerequisites, objectives, outcomes, and detailed explanations of JDBC, including its types of drivers and methods for database connectivity. Additionally, it provides examples of using JDBC interfaces such as Connection, Statement, and PreparedStatement for executing SQL queries in Java applications.

Uploaded by

ashishyogi051
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 47

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Domain Summer Winning Camp 2024


Subject Name: Advanced Java
Day:15
Topics Covered: CRUD operations using Database

DISCOVER . LEARN . EMPOWER


1
These points related to Day wise topic should be included :
Prerequisites:

Basic understanding of SQL (Structured Query Language) for performing database operations.

Familiarity with relational database concepts such as tables, primary keys, foreign keys, and normalization.

Knowledge of Java programming, including object-oriented programming principles.

Basic understanding of JDBC (Java Database Connectivity) for connecting Java applications to databases.

Objectives:

To introduce the fundamental CRUD (Create, Read, Update, Delete) operations necessary for managing data in relational databases.

To understand how to implement CRUD operations in Java applications using JDBC.

To learn best practices for handling database operations, including transaction management and exception handling.

To explore the use of PreparedStatement to improve security and performance of database operations.

To develop skills for designing and implementing DAO (Data Access Object) classes to encapsulate CRUD operations.

Outcomes:

Proficiency in writing SQL statements for performing CRUD operations on database tables.

Ability to connect a Java application to a relational database using JDBC.

Understanding of how to use JDBC API components (Connection, Statement, PreparedStatement, ResultSet) to execute CRUD operations.
2
Knowledge of transaction management to ensure data integrity and consistency during multiple CRUD operations.

Skill in handling SQLExceptions and other database-related exceptions in a Java application.


What is JDBC?

• JDBC stands for Java Database Connectivity.


• JDBC is a Java API to connect and execute the query with the database.
• It is a part of JavaSE (Java Standard Edition).
• JDBC API is used to access tabular data stored in any relational
database.
• By the help of JDBC API, we can save, update, delete and fetch data
from the database.
• It is like Open Database Connectivity (ODBC) provided by Microsoft.

3
JDBC Drivers

• JDBC Driver is a software component that enables java application to


interact with the database.
• There are four types of JDBC drivers:
1. JDBC-ODBC Bridge Driver,
2. Native Driver,
3. Network Protocol Driver, and
4. Thin Driver

Figure 1 : JDBC Drivers

4
Type 1: JDBC-ODBC Bridge Driver

• A JDBC bridge is used to access ODBC drivers installed on each


client machine.
• Using ODBC, requires configuring on your system a Data Source
Name (DSN) that represents the target database.

Note: -
When Java first came out, this was a useful driver because most
databases only supported ODBC access but now this type of driver is
recommended only for experimental use or when no other alternative is
available.
5
Type 1: JDBC-ODBC Bridge Driver

Figure2(a): JDBC-ODBC Bridge Driver[2]

Figure2(b): JDBC-ODBC Bridge Driver[9]


6
Type 2 : JDBC-Native API

• JDBC API calls are converted into native C/C++ API calls, which are
unique to the database.
• These drivers are typically provided by the database vendors and
used in the same manner as the JDBC-ODBC Bridge.
• The vendor-specific driver must be installed on each client machine.
• If we change the Database, we have to change the native API, as it is
specific to a database and they are mostly obsolete now, but you may
realize some speed increase with a Type 2 driver, because it
eliminates ODBC's overhead.

7
Type 2 : JDBC-Native API

Figure3(a): JDBC-Native API[2]

Figure(3b): JDBC-Native API[9]


8
Type 3 : Network protocol driver

• A three-tier approach is used to access databases. The JDBC clients


use standard network sockets to communicate with a middleware
application server. The socket information is then translated by the
middleware application server into the call format required by the
DBMS, and forwarded to the database server.
• This kind of driver is extremely flexible, since it requires no code
installed on the client and a single driver can actually provide access
to multiple databases.

9
Type 3 :Network protocol driver

Figure4(a): Network Protocol Driver[2]

Figure4(b): JDBC-Net pure Java[9]

10
Type 4 : Thin Driver

• In a Type 4 driver, a pure Java-based driver communicates directly


with the vendor's database through socket connection. This is the
highest performance driver available for the database and is usually
provided by the vendor itself.
• This kind of driver is extremely flexible, you don't need to install
special software on the client or server. Further, these drivers can be
downloaded dynamically.

11
Type 4 : Thin Driver

Figure5(a): Thin Driver [2]

Figure5(b): Type 4-100% pure Java


[9]
12
Package for JDBC API

The java.sql package contains classes and interfaces for JDBC API.

Interfaces for JDBC API Classes for JDBC API


1. Driver interface 1. DriverManager class
2. Connection interface 2. Blob class
3. Statement interface 3. Clob class
4. PreparedStatement interface 4. Types class
5. CallableStatement interface
6. ResultSet interface
7. ResultSetMetaData interface
8. DatabaseMetaData interface
9. RowSet interface 13
Five Connectivity Steps

1. Register the Driver class


2. Create connection
3. Create statement
4. Execute queries
5. Close connection

Note: Before performing these five steps your should have to import
sql package.
import java.sql.* ;
14
Five Connectivity Steps: Methods used and their Syntax
Steps Method Syntax
Register the driver class forName() of Class class public static void forName(String className)throws ClassNotFoundException

Create the connection getConnection() method of 1) public static Connection getConnection(String url)throws SQLException
object DriverManager class 2) public static Connection getConnection(String url,String name,String passwo
rd)
throws SQLException

Create the Statement createStatement() method of public Statement createStatement()throws SQLException


object Connection interface

Execute the query executeQuery() method of public ResultSet executeQuery(String sql)throws SQLException
Statement interface

Close the connection public void close()throws S


object QLException

15
Five Connectivity Steps: Examples
Steps Example
Register the driver class Class.forName("oracle.jdbc.driver.OracleDriver");

Create the connection object Connection con=DriverManager.getConnection( "jdbc:oracle:thin:@localhost:1521:xe","system","passw


ord");

Create the Statement object Statement stmt=con.createStatement();

Execute the query ResultSet rs=stmt.executeQuery("select * from emp");

while(rs.next()){
System.out.println(rs.getInt(1)+" "+rs.getString(2));
}
Close the connection object con.close();

16
DriverManager class

• The DriverManager class is the component of JDBC API and


also a member of the java.sql package. The DriverManager
class acts as an interface between users and drivers. It keeps
track of the drivers that are available and handles establishing
a connection between a database and the appropriate driver.
It contains all the appropriate methods to register and
deregister the database driver class and to create a
connection between a Java application and the database. The
DriverManager class maintains a list of Driver classes that
have registered themselves by calling the method
DriverManager.registerDriver(). Note that before interacting
with a Database, it is a mandatory process to register the
driver; otherwise, an exception is thrown.
17
Methods of the DriverManager Class
Method Description
1) public static synchronized void registerDriver(Driver driver): is used to register the given driver with DriverManager. No action is
performed by the method when the given driver is already registered.

2) public static synchronized void deregisterDriver(Driver driver): is used to deregister the given driver (drop the driver from the list) with
DriverManager. If the given driver has been removed from the list, then no
action is performed by the method.
3) public static Connection getConnection(String url) throws is used to establish the connection with the specified url. The
SQLException: SQLException is thrown when the corresponding Driver class of the given
database is not registered with the DriverManager.
4) public static Connection getConnection(String url,String is used to establish the connection with the specified url, username, and
userName,String password) throws SQLException: password. The SQLException is thrown when the corresponding Driver
class of the given database is not registered with the DriverManager.

5) public static Driver getDriver(String url) Those drivers that understand the mentioned URL (present in the
parameter of the method) are returned by this method provided those
drivers are mentioned in the list of registered drivers.
6) public static int getLoginTimeout() The duration of time a driver is allowed to wait in order to establish a
connection with the database is returned by this method.

7) pubic static void setLoginTimeout(int sec) The method provides the time in seconds. sec mentioned in the
parameter is the maximum time that a driver is allowed to wait in order to
establish a connection with the database. If 0 is passed in the parameter
of this method, the driver will have to wait infinitely while trying to
establish the connection with the database.

8) public static Connection getConnection(String URL, Properties A connection object is returned by this method after creating a connection
prop) throws SQLException to the database present at the mentioned URL, which is the first
parameter of this method. The second parameter, which is "prop", fetches
the authentication details of the database (username and password.).
Similar to the other variation of the getConnection() method, this method
also throws the SQLException, when the corresponding Driver class of the
given database is not registered with the DriverManager.
18
Connection interface

• A Connection is a session between a Java application and a


database. It helps to establish a connection with the database.
• The Connection interface is a factory of Statement,
PreparedStatement, and DatabaseMetaData, i.e., an object of
Connection can be used to get the object of Statement and
DatabaseMetaData. The Connection interface provide many
methods for transaction management like commit(), rollback(),
setAutoCommit(), setTransactionIsolation(), etc.
Commonly used methods of Connection interface:
• 1) public Statement createStatement(): creates a
statement object that can be used to execute SQL queries.
• 2) public Statement createStatement(int
resultSetType,int resultSetConcurrency): Creates a
Statement object that will generate ResultSet objects with the
given type and concurrency.
19
3) public void setAutoCommit(boolean status): is used to set the commit status. By
default, it is true.
4) public void commit(): saves the changes made since the previous commit/rollback is
permanent.
5) public void rollback(): Drops all changes made since the previous commit/rollback.
6) public void close(): closes the connection and Releases a JDBC resources immediately.

20
Statement interface

The Statement interface provides methods to execute queries with the database. The statement
interface is a factory of ResultSet i.e. it provides factory method to get the object of ResultSet.

Commonly used methods of Statement interface:


The important methods of Statement interface are as follows:
• 1) public ResultSet executeQuery(String sql): is used to execute SELECT query. It returns the
object of ResultSet.
• 2) public int executeUpdate(String sql): is used to execute specified query, it may be create,
drop, insert, update, delete etc.
• 3) public boolean execute(String sql): is used to execute queries that may return multiple results.
• 4) public int[] executeBatch(): is used to execute batch of commands.

21
Example of Statement interface
Let’s see the simple example of Statement interface to insert, update and delete the record.
import java.sql.*;
class FetchRecord{
public static void main(String args[])throws Exception{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","syste
m","oracle");
Statement stmt=con.createStatement();

//stmt.executeUpdate("insert into emp765 values(33,'Irfan',50000)");


//
int result=stmt.executeUpdate("update emp765 set name='Vimal',salary=10000 where id=
33");
int result=stmt.executeUpdate("delete from emp765 where id=33");
System.out.println(result+" records affected");
con.close();
}}

22
ResultSet interface
The object of ResultSet maintains a cursor pointing to a
row of a table. Initially, cursor points to before the first
row.

• But we can make this object to move forward and


backward direction by passing either
TYPE_SCROLL_INSENSITIVE or TYPE_SCROLL_SENSITIVE
in createStatement(int,int) method as well as we can
make this object as updatable by:
1.Statement stmt = con.createStatement(ResultSet.TYPE_
SCROLL_INSENSITIVE,
2. ResultSet.CONCUR_UPDATABLE);
23
Commonly used methods of ResultSet interface
1) public boolean next(): is used to move the cursor to the one row next from the current position.

2) public boolean previous(): is used to move the cursor to the one row previous from the current position.

3) public boolean first(): is used to move the cursor to the first row in result set object.

4) public boolean last(): is used to move the cursor to the last row in result set object.

5) public boolean absolute(int row): is used to move the cursor to the specified row number in the ResultSet
object.

6) public boolean relative(int row): is used to move the cursor to the relative row number in the ResultSet object,
it may be positive or negative.

7) public int getInt(int columnIndex): is used to return the data of specified column index of the current row as int.

8) public int getInt(String is used to return the data of specified column name of the current row as int.
columnName):
9) public String getString(int is used to return the data of specified column index of the current row as
columnIndex): String.

10) public String getString(String is used to return the data of specified column name of the current row as
columnName): String.
24
Example of Scrollable ResultSet
Let’s see the simple example of ResultSet interface to retrieve the data of 3rd row.
import java.sql.*;
class FetchRecord{
public static void main(String args[])throws Exception{

Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","syste
m","oracle");
Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCU
R_UPDATABLE);
ResultSet rs=stmt.executeQuery("select * from emp765");

//getting the record of 3rd row


rs.absolute(3);
System.out.println(rs.getString(1)+" "+rs.getString(2)+" "+rs.getString(3));

con.close();
}}
25
PreparedStatement interface

• The PreparedStatement interface is a subinterface of


Statement. It is used to execute parameterized query.
• Let's see the example of parameterized query:
1.String sql="insert into emp values(?,?,?)";
• As you can see, we are passing parameter (?) for the
values. Its value will be set by calling the setter
methods of PreparedStatement.
• Why use PreparedStatement?
• Improves performance: The performance of the
application will be faster if you use PreparedStatement
interface because query is compiled only once.

26
How to get the instance of PreparedStatement?
The prepareStatement() method of Connection interface is used to return the object of PreparedStatement. Syntax:

public PreparedStatement prepareStatement(String query)throws SQLException{}

Methods of PreparedStatement interface


The important methods of PreparedStatement interface are given below:

Method Description

public void setInt(int paramIndex, int value) sets the integer value to the given parameter index.

public void setString(int paramIndex, String sets the String value to the given parameter index.
value)

public void setFloat(int paramIndex, float sets the float value to the given parameter index.
value)

public void setDouble(int paramIndex, sets the double value to the given parameter index.
double value)

public int executeUpdate() executes the query. It is used for create, drop, insert, update, delete etc.

public ResultSet executeQuery() executes the select query. It returns an instance of ResultSet.

27
Example of PreparedStatement interface that inserts the record

First of all create table as given below:


create table emp(id number(10),name varchar2(50));
Now insert records in this table by the code given below:
import java.sql.*;
class InsertPrepared{
public static void main(String args[]){
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
PreparedStatement stmt=con.prepareStatement("insert into Emp values(?,?)");
stmt.setInt(1,101);//1 specifies the first parameter in the query
stmt.setString(2,"Ratan");
int i=stmt.executeUpdate();
System.out.println(i+" records inserted");
con.close();
}catch(Exception e){ System.out.println(e);}
}
}
28
Java ResultSetMetaData Interface

• The metadata means data about data i.e. we can get further
information from the data.
• If you have to get metadata of a table like total number of column,
column name, column type etc. , ResultSetMetaData interface is useful
because it provides methods to get metadata from the ResultSet object.
Commonly used methods of ResultSetMetaData interface
Method Description

public int getColumnCount()throws it returns the total number of columns in the ResultSet
SQLException object.

public String getColumnName(int it returns the column name of the specified column
index)throws SQLException index.

public String getColumnTypeName(int it returns the column type name for the specified index.
index)throws SQLException

public String getTableName(int it returns the table name for the specified column
index)throws SQLException index.
29
How to get the object of Example of ResultSetMetaData interface :
import java.sql.*;
ResultSetMetaData: class Rsmd{
public static void main(String args[]){
The getMetaData() method of try{
ResultSet interface returns the Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection(
object of ResultSetMetaData. "jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
Syntax:
PreparedStatement ps=con.prepareStatement("select * fro
public ResultSetMetaData m emp");
ResultSet rs=ps.executeQuery();
getMetaData()throws ResultSetMetaData rsmd=rs.getMetaData();
SQLException System.out.println("Total columns: "+rsmd.getColumnCoun
t());
System.out.println("Column Name of 1st column: "+rsmd.g
etColumnName(1));
System.out.println("Column Type Name of 1st column: "+rs
md.getColumnTypeName(1));

con.close();
}catch(Exception e){ System.out.println(e);}
} Output:Total columns: 2
Column Name of 1st column: ID
} 30
Column Type Name of 1st column: NUMBER
JDBC Driver names and Database URLs
Table 2 Following table lists the popular JDBC driver names and database URLs.

RDBMS JDBC driver name URL format

MySQL com.mysql.jdbc.Driver jdbc:mysql://hostname/ databaseName

ORACLE oracle.jdbc.driver.OracleDriver jdbc:oracle:thin:@hostname:port Number:databaseName

DB2 COM.ibm.db2.jdbc.net.DB2Driver jdbc:db2:hostname:port Number/databaseName

Sybase com.sybase.jdbc.SybDriver jdbc:sybase:Tds:hostname: port Number/databaseName

31
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class JDBCExample {


static final String DB_URL = "jdbc:mysql://localhost/";
static final String USER = "guest";
JDBC: static final String PASS = "guest123";

Create Database public static void main(String[] args) {


// Open a connection
try(Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
Statement stmt = conn.createStatement();
){
String sql = "CREATE DATABASE STUDENTS";
stmt.executeUpdate(sql);
System.out.println("Database created successfully...");
} catch (SQLException e) {
e.printStackTrace();
}
}
}

32
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class TestApplication {


static final String DB_URL = "jdbc:mysql://localhost/";
static final String USER = "guest";
static final String PASS = "guest123";

public static void main(String[] args) {


// Open a connection
JDBC: try(Connection conn = DriverManager.getConnection(DB_URL, USER,
PASS);
Create Table Database Statement stmt = conn.createStatement();
){
String sql = "CREATE TABLE REGISTRATION " +
"(id INTEGER not NULL, " +
" first VARCHAR(255), " +
" last VARCHAR(255), " +
" age INTEGER, " +
" PRIMARY KEY ( id ))";

stmt.executeUpdate(sql);
System.out.println("Created table in given database...");
} catch (SQLException e) {
e.printStackTrace();
}
}
} 33
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class JDBCExample {


static final String DB_URL = "jdbc:mysql://localhost/";
static final String USER = "guest";
static final String PASS = "guest123";

public static void main(String[] args) {


// Open a connection
JDBC: try(Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
Statement stmt = conn.createStatement();
Insert Records ){
// Execute a query
System.out.println("Inserting records into the table...");
String sql = "INSERT INTO Registration VALUES (100, 'Zara', 'Ali', 18)";
stmt.executeUpdate(sql);
sql = "INSERT INTO Registration VALUES (101, 'Mahnaz', 'Fatma', 25)";
stmt.executeUpdate(sql);
sql = "INSERT INTO Registration VALUES (102, 'Zaid', 'Khan', 30)";
stmt.executeUpdate(sql);
sql = "INSERT INTO Registration VALUES(103, 'Sumit', 'Mittal', 28)";
stmt.executeUpdate(sql);
System.out.println("Inserted records into the table...");
} catch (SQLException e) {
e.printStackTrace();
}
}
34
}
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class JDBCExample {


static final String DB_URL = "jdbc:mysql://localhost/";
static final String USER = "guest";
static final String PASS = "guest123";
static final String QUERY = "SELECT id, first, last, age FROM Registration";

JDBC: public static void main(String[] args) {

Select Records // Open a connection


try(Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(QUERY);
){
while(rs.next()){
//Display values
System.out.print("ID: " + rs.getInt("id"));
System.out.print(", Age: " + rs.getInt("age"));
System.out.print(", First: " + rs.getString("first"));
System.out.println(", Last: " + rs.getString("last"));
}
} catch (SQLException e) {
e.printStackTrace();
}
}
} 35
Reference (Links)

1) https://www.javatpoint.com/java-jdbc
2) https://www.javatpoint.com/jdbc-driver
3) https://www.javatpoint.com/steps-to-connect-to-the-database-in-java
4) JDBC - Database Connections (tutorialspoint.com)
5) JDBC - Insert Records Example (tutorialspoint.com)
6) JDBC - Select Records Example (tutorialspoint.com)
7) JDBC - Update Records Example (tutorialspoint.com)
8) JDBC - Delete Records Example (tutorialspoint.com)
9) JDBC - Driver Types (tutorialspoint.com)
10) 47 Advanced JDBC Interview Questions & Answers For Experienced (codingcompiler.com)

36
Reference (Books)

1) Balaguruswamy, Java.
2) A Primer, E.Balaguruswamy, Programming with Java, Tata McGraw Hill Companies
3) John P. Flynt Thomson, Java Programming.

37
Practice Question
https://www.hackerrank.com/challenges/japanese-cities-attributes/problem
https://www.hackerrank.com/challenges/weather-observation-station-3/problem?h_r=internal-search
https://www.hackerrank.com/challenges/name-of-employees/problem?h_r=internal-search
https://www.hackerrank.com/challenges/salary-of-employees/problem?h_r=internal-search
https://leetcode.com/problems/nth-highest-salary/
https://leetcode.com/problems/rank-scores/description/
https://leetcode.com/problems/customers-who-never-order/
https://leetcode.com/problems/sales-person/
https://leetcode.com/problems/classes-more-than-5-students/

38
39
40
41
42
43
Placement Related Questions:
1. Can you explain what CRUD operations are and why they are fundamental to database management?
2. Describe the process of creating a new record in a database. What SQL statement is used, and how would
you implement this operation in Java using JDBC?
3. How would you read or retrieve data from a database? Discuss the SQL query used for this purpose and
how you would handle this operation in a Java application.
4. Explain how you would update an existing record in a database. What are the key considerations to ensure
data integrity during an update operation?
5. Describe the steps involved in deleting a record from a database. What SQL command is used, and how
would you perform this operation using JDBC in Java?
6. What is the role of the PreparedStatement interface in performing CRUD operations? How does it improve
security and performance compared to using the Statement interface?
7. Discuss how you would handle exceptions during CRUD operations in a JDBC application. What are
some common exceptions, and how should they be managed?
8. Explain the importance of transaction management during CRUD operations. How would you ensure that
a series of CRUD operations are executed as a single transaction?
9. Provide an example of a Java method that performs a batch update of records in a database. How does
batch processing improve the efficiency of update operations?
44
10. How would you design a DAO (Data Access Object) class to encapsulate CRUD operations for a specific
entity in a Java application? What are the benefits of using the DAO pattern?
Worksheets
• https://www.hackerrank.com/challenges/name-of-employees/problem?
h_r=internal-search
• https://www.hackerrank.com/challenges/salary-of-employees/problem?
h_r=internal-search
• https://leetcode.com/problems/rank-scores/description/
• https://leetcode.com/problems/classes-more-than-5-students/
• https://tests.mettl.com/authenticateKey/d2272e10
• https://leetcode.com/problems/search-insert-position/description/
• https://leetcode.com/problems/climbing-stairs/description/
• https://leetcode.com/problems/perfect-squares/description/
45
References
Books:
• 1. Balaguruswamy, Java.
• 2. A Primer, E.Balaguruswamy, Programming with Java, Tata McGraw Hill Companies
• 3. John P. Flynt Thomson, Java Programming.
Reference Links:
• https://www.tutorialspoint.com/jdbc/jdbc-statements.htm
• https://docs.oracle.com/javase/tutorial/jdbc/basics/processingsqlstatements.html
• https://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html
• https://www.javatpoint.com/Statement-interface
• https://www.javatpoint.com/PreparedStatement-interface
• https://www.javatpoint.com/CallableStatement-interface

46
Video Link:
• https://youtu.be/eEqPrlu28Sc
• https://youtu.be/v5vLuCBv8vg
Thank you

47

You might also like