Sunday, 27 October 2024

Write a java program to connect database (MySQL) using JDBC.


 

Advanced Java: 04

Q.1 Write a java Program to connect Database (MySQL) using JDBC.


Q.2 Write a java Program to Store an accounts data (accountno, name, balance) into the database.
  • Before writing and executing this program the following things should have done in MySQL DBMS.
  • Open MySQL Client Console. enter the password root.
  • mysql > create database hdfcdb;
  • mysql > use hdfcdb;
  • mysql > show tables.
  • mysql > create table account (accuntno int (11), name varchar (20), balance double (10,2)).
  • mysql > select * from account.




Q.3 Write a java Program to increase the balance of all the accounts by Rs. 1000.




After execution of code:






data structures and algorithms Web Developer

No comments:

Post a Comment