Академический Документы
Профессиональный Документы
Культура Документы
Practical -2 1). Consider a bank table which consist attributes (id, acc_name,acc_type, balance,mobile). Insert data with help of Statement, PreparedStatment and CallableStatment. For CallableStatment, you need to create a procedure. Ans.
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package practical.pkg2; import java.sql.*; import javax.swing.*; /** * * @author sonal */ public class newbank1 { public static void main(String args[]) { newbank nb = new newbank(); JOptionPane.showMessageDialog(null, "JDBC Programming showing Statement, PreparedStatment and CallableStatment"); int choice = -1;
090750116062
Soni Sonal G.
Page 20
Output:-
090750116062
Soni Sonal G.
Page 25
090750116062
Soni Sonal G.
Page 26
Procedure:CREATE DEFINER=root@localhost PROCEDURE Insert_data{ IN p_bank_id INT(11), IN p_acc_name VARCHAR(50), IN p_acc_type VARCHAR(20),
090750116062 Soni Sonal G. Page 27
090750116062
Soni Sonal G.
Page 28
090750116062
Soni Sonal G.
Page 29