Professional Documents
Culture Documents
2022-2023
Micro Project Report
On
Prof. DESHMUKH R. R.
(Lecturer)
In Pursuit of Excellence
Certificate of Completion
This is to certify that Sofiyan Shakih, Om kathar, Shashank Umarekar with Enrollment No
"Query Creator Application” in the Subject of "Advanced Java Programming" in the fifth
semester during their tenure of completing the Diploma programme in Computer Engineering
Dr. Patil B. M.
Principal
INDEX
Micro-Project Proposal
1.0 Rational 1
Micro-Project Report
1.0 Rational 3
1.0 Rationale
In this project, we are going to make a query creator application using java.
The query creator application is a desktop system that provides a simple way to create
a query.Query Creator are used to easily create SQL queries that help you to get fast
and accurate results without any knowledge of SQL or coding. The query builder
takes input parameters from the user and then generate a query. This application is
used to make the query of create table, insert, update, delete data using a simple way.
1
4.0 Action Plan
Planned
S. Planned Name of Responsible
Details of activity Finish
No. Start date Team Members
date
1 Select the topic as per the subject
and Study the Concept of SQL 22/08/22 27/08/22
and AWT components.
*************
2
Annexure –II B
PART B
Query Creator Application
1.0 Rationale
In this project, we are going to make a query creator application using java.
The query creator application is a desktop system that provides a simple way to create
a query. Query Creator are used to easily create SQL queries that help you to get fast
and accurate results without any knowledge of SQL or coding. The query builder
takes input parameters from the user and then generate a query. This application is
used to make the query of create table, insert, update, delete data using a simple way.
3
AWT is heavy weight i.e. its components are using the resources of underlying
operating system (OS).
1. Label :-
It is called a passive control as it does not create any event when it is
accessed. To create a label, we need to create the object of Label class.
2. TextField :-
The object of a TextField class is a text component that allows a user
to enter a single line text and edit it. It inherits TextComponent class,
which further inherits Component class.
3. Button :-
A button is basically a control component with a label that generates an
event when pushed. The Button class is used to create a labeled button that
has platform independent implementation. The application result in some
action when the button is pushed.
Following are the Classes and Interfaces that are used for hanling the AWT
components
ActionListener Interface :-
The Java ActionListener is notified whenever you click on the button
or menu item. It is notified against ActionEvent. The ActionListener interface
is found in java.awt.event package
4
4.0 Actual Procedure Followed.
Program : -
import java.awt.*;
import java.awt.event.*;
// Home Page //
5
add(insert);
table.addActionListener(new NewFrame());
insert.addActionListener(new NewFrame());
update.addActionListener(new NewFrame());
delete.addActionListener(new NewFrame());
}
if(ob == table)
{
TableCreator tc = new TableCreator();
tc.setSize(1900,1000);
setVisible(false);
tc.setVisible(true);
}
if(ob == insert)
{
6
InsertQuery iq = new InsertQuery();
iq.setSize(1900,1000);
setVisible(false);
iq.setVisible(true);
}
if(ob == update)
{
UpdateQuery uq = new UpdateQuery();
uq.setSize(1900,1000);
setVisible(false);
uq.setVisible(true);
}
if(ob == delete)
{
DeleteQuery dq = new DeleteQuery();
dq.setSize(1900,1000);
setVisible(false);
dq.setVisible(true);
}
}
}
//Create Table
class TableCreator extends Frame
{
TextField tbname;
7
TextField attr[] = new TextField[5];
TextField datatype[] = new TextField[5];
Button add[] = new Button[5];
Button ct,back;
Label query;
int num = 0;
int i;
String res;
int attrspace = 460;
int btnpos = 540;
Font f = new Font("SansSerif" ,Font.BOLD,45);
Font f1 = new Font("Arial" , Font.BOLD , 25);
Font font = new Font("SansSerif" , Font.BOLD ,18);
Font f2 = new Font("SansSerif" , Font.BOLD , 26);
public TableCreator()
{
setLayout(null);
setBackground(Color.YELLOW);
8
tbname = new TextField(15);
tbname.setBounds(320,200,250,40);
tbname.setFont(f1);
add(tbname);
9
add(ct);
ct.addActionListener(new CreateQuery());
add[num].addActionListener(new AttributeCreator());
back.addActionListener(new Back());
}
10
add[num] = new Button(" + ");
add[num].setBounds(850,attrspace,50,40);
add[num].setFont(f1);
add(add[num]);
ct.setBounds(350,btnpos,200,40);
attrspace = attrspace + 80;
btnpos = btnpos + 80;
add[num].addActionListener(new AttributeCreator());
}
11
for(i = 0 ; i <= num ; i++)
{
ab[i] = attr[i].getText();
dt[i] = datatype[i].getText();
}
if(num == 0)
{
res = "Your Query Result = CREATE TABLE " +
tname + "( " + ab[0] + " " + dt[0] + ");" ;
}
if(num == 1)
{
res = "Your Query Result = CREATE TABLE " +
tname + "( " + ab[0] + " " + dt[0] + ", " + ab[1] + " " +
dt[1] + ");" ;
}
if(num == 2)
{
res = "Your Query Result = CREATE TABLE " +
tname + "( " + ab[0] + " " + dt[0] + ", " + ab[1] + " " +
dt[1] + ", " + ab[2] + " " + dt[2] + ");" ;
}
if(num == 3)
{
res = "Your Query Result = CREATE TABLE " +
tname + "( " + ab[0] + " " + dt[0] + ", " + ab[1] + " " +
dt[1] + ", " + ab[2] + " " + dt[2] + ", "+ ab[3] + " " +
dt[3] +");" ;
}
if(num == 4)
{
12
res = "Your Query Result = CREATE TABLE " +
tname + "( " + ab[0] + " " + dt[0] + ", " + ab[1] + " " +
dt[1] + ", " + ab[2] + " " + dt[2] + ", "+ ab[3] + " " +
dt[3] + ", " + ab[4] + " " + dt[4] +");" ;
}
query.setText(res);
}
}
}
public InsertQuery()
{
setLayout(null);
setBackground(Color.YELLOW);
13
back = new Button("Back");
back.setBounds(100,100,100,40);
back.setFont(f1);
add(back);
14
lb3.setFont(f1);
ins.addActionListener(new CreateInsertQuery());
add[num].addActionListener(new AttributeCreator());
back.addActionListener(new Back());
}
15
}
ins.setBounds(350,btnpos,200,40);
attrspace = attrspace + 80;
btnpos = btnpos + 80;
add[num].addActionListener(new AttributeCreator());
}
16
qs.setSize(1900,1000);
qs.setVisible(true);
}
}
if(num == 0)
{
res = "Your Query Result = INSERT INTO " + tname
+ " (" + ab[0] + " )" + " VALUES (" + val[0] + " );" ;
}
if(num == 1)
{
res = "Your Query Result = INSERT INTO " + tname
+ " (" + ab[0] + ", " + ab[1] + " )" + " VALUES (" +
val[0] + ", " + val[1] + " );" ;
}
17
if(num == 2)
{
res = "Your Query Result = INSERT INTO " + tname
+ " (" + ab[0] + ", " + ab[1] + ", " + ab[2] + " )" + "
VALUES (" + val[0] + ", " + val[1] + ", " + val[2] + "
);" ;
}
if(num == 3)
{
res = "Your Query Result = INSERT INTO " + tname
+ " (" + ab[0] + ", " + ab[1] + ", " + ab[2] + ", " + ab[3]
+ " )" + " VALUES (" + val[0] + ", " + val[1] + ", " +
val[2] + ", " + val[3] + " );" ;
}
if(num == 4)
{
res = "Your Query Result = INSERT INTO " + tname
+ " (" + ab[0] + ", " + ab[1] + ", " + ab[2] + ", " + ab[3]
+ ", " + ab[4] + " )" + " VALUES (" + val[0] + ", " +
val[1] + ", " + val[2] + ", " + val[3] + ", " + val[4] + "
);" ;
}
query.setText(res);
}
}
}
18
Button add[] = new Button[5];
Button updt,back;
Label query;
int num = 0;
int i;
String res;
int attrspace = 460;
int btnpos = 540;
Font f = new Font("SansSerif" ,Font.BOLD,45);
Font f1 = new Font("Arial" , Font.BOLD , 25);
Font font = new Font("SansSerif" , Font.BOLD ,18);
Font f2 = new Font("SansSerif" , Font.BOLD , 26);
public UpdateQuery()
{
setLayout(null);
setBackground(Color.YELLOW);
19
tbname.setBounds(320,200,250,40);
tbname.setFont(f1);
add(tbname);
20
attr[num] = new TextField(15);
attr[num].setBounds(100,380,250,40);
attr[num].setFont(f1);
add(attr[num]);
updt.addActionListener(new CreateQuery());
add[num].addActionListener(new AttributeCreator());
back.addActionListener(new Back());
21
}
22
for(i = 0 ; i <= num ; i++)
{
ab[i] = attr[i].getText();
val[i] = values[i].getText();
}
if(num == 0)
{
res = "Your Query Result = UPDATE " +
tname + " SET " + ab[0] + " = " + val[0] + "
WHERE " + con_ab + " = " + con_val + " ;" ;
}
if(num == 1)
{
res = "Your Query Result = UPDATE " + tname + "
SET " + ab[0] + " = " + val[0] + ", " + ab[1] + " = " +
val[1] + " WHERE " + con_ab + " = " + con_val + " ;" ;
}
if(num == 2)
{
res = "Your Query Result = UPDATE " + tname + "
SET " + ab[0] + " = " + val[0] + ", " + ab[1] + " = " +
val[1] + ", " + ab[2] + " = " + val[2] + " WHERE " +
con_ab + " = " + con_val + " ;" ;
}
if(num == 3)
{
res = "Your Query Result = UPDATE " + tname + "
SET " + ab[0] + " = " + val[0] + ", " + ab[1] + " = " + val[1] +
", " + ab[2] + " = " + val[2] + ", " + ab[3] + " = " + val[3] + "
WHERE " + con_ab + " = " + con_val + " ;" ;
}
if(num == 4)
23
{
res = "Your Query Result = UPDATE " + tname + "
SET " + ab[0] + " = " + val[0] + ", " + ab[1] + " = " +
val[1] + ", " + ab[2] + " = " + val[2] + ", " + ab[3] + " =
" + val[3] + ", " + ab[4] + " = " + val[4] + " WHERE " +
con_ab + " = " + con_val + " ;" ; }
query.setText(res);
}
}
updt.setBounds(350,btnpos,200,40);
attrspace = attrspace + 80;
btnpos = btnpos + 80;
add[num].addActionListener(new AttributeCreator());
24
}
}
public DeleteQuery()
{
setLayout(null);
setBackground(Color.YELLOW);
25
lb1.setBounds(100,200,200,40);
lb1.setFont(f1);
26
query.setBounds(10,800,1700,60);
query.setFont(f2);
query.setForeground(Color.red);
add(query);
del.addActionListener(new DeleteQueryCreator());
back.addActionListener(new Back());
}
27
}
}
S. Name of
Specifications Qty Remarks
No. Resource/material
1 Computer System Any Desktop PC with
1
basic Configuration
2 Software Jdk 1.8 1
Home Page :-
28
Create Table Query Page :-
29
Create Delete Query Page :-
In this paper we propose a dynamic query form generation approach which helps
users dynamically generate query forms. As future work, we will study how our approach
can be extended to non-relational data and how we connect to all databases with our
application. As for the future work, we plan to develop multiple methods to capture the user’s
interest for the queries besides the click feedback. Also we make it more user friendly.
30