Professional Documents
Culture Documents
Create a console based application using Java as frontend and Oracle as backend for their
Inventory and Sales maintenance.
3. Code:
import java.sql.*;
import java.util.Scanner;
try{
String name1=null;
String prod=null;
int qt;
@SuppressWarnings("resource")
Scanner sc=new Scanner(System.in);
System.out.println();
name1=sc.next();
prod=sc.next();
qt=sc.nextInt();
Class.forName("com.mysql.cj.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/aryangupta","root","ag1234");
Statement stmt=con.createStatement();
ps.setString(2,prod);
ps.setInt(3,qt);
ps.executeUpdate();
System.out.println("Successfully Inserted!");
while(rs.next())
System.out.println("Successfully Inserted!");
con.close();
4. Output:
Learning outcomes (What I have learnt):
Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty):