Q)Explain about getConnection() method of DriverManager. =>getConnection() is a JDBC API method(library method). =>It belongs to java.sql.DriverManager class. =>It is a static method. =>This method provides database connection to a JDBC client =>This method takes 3 String arguments. 1)database url(connection string) 2)user name 3)password =>This method throws java.sql.SQLException if anything goes wrong while establishing connection with the databse server. =>This method is a factory method. Q)How to make JDBC driver available to the JDBC client? Step 1:- Download the driver. For eg. mysql connector for MySQL DBMS. Step 2:- SET CLASSPATH For eg. SET CLASSPATH=.;D:\mysql-connector-java-8.0.19.jar Q)Explain about executeUpdate() method. =>executeUpdate() is a JDBC API method. =>It belongs to java.sql.Statement object. =>This method is used to submit INSERT,UPDATE,DELETE SQL Statements from the JDBC client to the DBMS. =>This method returns an integer. This number represents the number of records affected in the database a result of that submitted SQL statement. =>This method throws SQLException if anything goes wrong. Q)JDBC Program to implement an interactive deposit service. import java.sql.*; import java.util.Scanner; class DepositApplication { public static void main(String[] args) throws SQLException { Scanner scanner=new Scanner(System.in); System.out.print("Enter the A/c Number:"); int accno=scanner.nextInt(); System.out.print("Enter the depositing amount Rs."); double damount=scanner.nextDouble(); Connection connection=DriverManager.getConnection("jdbc:mysql://localhost:3306/hdfcdb","root","ashokit"); Statement statement=connection.createStatement(); int re=statement.executeUpdate("UPDATE ACCOUNT SET BALANCE=BALANCE+"+damount+" WHERE ACCNO="+accno); if(re==0) System.out.println("Account doesn't exist"); else System.out.println("Amount deposited successfully"); statement.close(); connection.close(); } }