JDBC Program Select, Insert, Update, Delete records

Before running this program, create access database and add a table named 'emp' with the following fields
eno - Number
ename - Text
salary - Number
Cofingure ODBC in your system using Control Panel -> Administrative Tools -> ODBC

  1. span style="color: #006699;">java.io.*java.sql.*"*""sun.jdbc.odbc.JdbcOdbcDriver""jdbc:odbc:karthik""Choose Option""1. Select""2. Insert""3. Update""4. Delete""0. Exit""select * from emp""\t\t""\t\t""Enter E.No""Enter Name""Enter Salary""insert into emp values("+eno+",'"+ename+"',"+salary+")""1 Record inserted""Continue ? [y/n]""y""Enter E.No. to Edit :""Enter Name""Enter Salary""update emp set ename='"+ename+"', salary="+salary+" where eno =""1 Record Updated""Enter E.No. to Delete :""delete from emp where eno =""Record Deleted""Error :"+e.getMessage());
  2. }
  3. }
  4. }