0% found this document useful (0 votes)
42 views8 pages

Java - Experiment 3.1 Worksheet - 20BCS6512

The document summarizes a Java lab experiment to create a console application using Java as the frontend and Oracle as the backend for inventory and sales maintenance. The student's name, UID, branch, semester, subject name, and code are provided. The aim is to insert customer, product, and quantity data into an "inventory" table in Oracle using JDBC. The code connects to the Oracle database, inserts the input data using a prepared statement, and retrieves and prints the table contents. The student learned about Oracle, JDBC, connecting frontend and backend, and different database drivers.

Uploaded by

ayush sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views8 pages

Java - Experiment 3.1 Worksheet - 20BCS6512

The document summarizes a Java lab experiment to create a console application using Java as the frontend and Oracle as the backend for inventory and sales maintenance. The student's name, UID, branch, semester, subject name, and code are provided. The aim is to insert customer, product, and quantity data into an "inventory" table in Oracle using JDBC. The code connects to the Oracle database, inserts the input data using a prepared statement, and retrieves and prints the table contents. The student learned about Oracle, JDBC, connecting frontend and backend, and different database drivers.

Uploaded by

ayush sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Experiment -3.

Student Name: Harjit Singh Dhillon UID: 20BCS6512


Branch: AIML Section/Group: 20AIML 3A
Semester: 4th
Subject Name: Java Lab Subject Code: 20-csp-287

1. Aim of the practical:

Create a console based application using Java as frontend and Oracle as backend for their
Inventory and Sales maintenance.

2. Apparatus Required: VS Code/ Eclipse IDE/ IntelliJ IDEA

3. Code:

import [Link].*;

import [Link];

public class SQL {

public static void main(String[] args) {

try{
String name1=null;

String prod=null;

int qt;

@SuppressWarnings("resource")
Scanner sc=new Scanner([Link]);

[Link]("Enter the name of customer,product and quantity:");

[Link]();

name1=[Link]();

prod=[Link]();

qt=[Link]();

[Link]("[Link]");

Connection
con=[Link]("jdbc:mysql://localhost:3306/aryangupta","root","ag1234");

Statement stmt=[Link]();

PreparedStatement ps=[Link]("insert into inventory values(?,?,?)");


[Link](1,name1);

[Link](2,prod);

[Link](3,qt);

[Link]();

[Link]("Successfully Inserted!");

ResultSet rs=[Link]("select * from inventory");

[Link]("Contents of the Table Inventory are:");

while([Link]())

[Link]([Link](1)+" "+[Link](2)+" "+[Link](3));

[Link]("Successfully Inserted!");

[Link]();

}catch(Exception e){ [Link](e);}


}

4. Output:
Learning outcomes (What I have learnt):

1. I have learnt about oracle

2. I have learnt about JDBC

3. I have learnt how to connect frontend and backend

4. I have learnt about different drivers.

Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty):

Sr. No. Parameters Marks Obtained Maximum Marks


1.
2.
3.

You might also like