SlideShare a Scribd company logo
1 of 73
INFORMATICS PRACTICES
PROJECT FILE
ON
“TOUR AND TRAVELS MANAGEMNET”
Submitedto:Sir HimanshuSingh MadeBy:Harsh Verma
Mathur
Certificate
This is to certify that Harsh
Mathur of Class 12(Comm) Exam
Number ___________has
successfully completed his
assignment work in
INFORMATICS PRACTICES for
the term ending in year 2015-
2016.
______________ _______________
Sign of Teacher Sign of Principal
_______________ _______________
Sign of Examiner School Stamp
Acknowledgement
I express all my sincere thanks to my
institution Maharaja agrasen public school for
providing necessary facilities which were
required for the completion of this
assignment.
I also acknowledge the support received from
the i.p teacher Sir himanshu singh verma.
Without their help, Guidance and support it
could have been impossible to complete this
assignment.
Lastly I would thank the Principal of our
School meena sharma for providing an
opportunity to initiate ourselves with these
kind of assignment.
Need & Scope of the Project
This project has a wider scope in future and can be
helpful to many.Since this project is made in java and
mysql which makes this project wonder and innovative
and helps in clearing the concept of java and mysql.
This project also clears the relationship between java
and mysql.This also shows how java and mysql are
connected together in an application.This project can
be needed in future for tour & travel and also this
project can be helpful to tour which deal with their
transaction online on a regular basis.
JAVA
Java is a programming language originally developed by James
Gosling at Sun Microsystems (which has since merged into Oracle
Corporation) and released in 1995 as a core component of Sun
Microsystems' Java platform. The language derives much of
its syntax from C and C++, but it has fewerlow-level facilities than either of
them. Java applications are typically compiled to bytecode (class file) that
can run on any Java virtual machine (JVM) regardless of computer
architecture. Java is a general-purpose, concurrent, class-based, object-
oriented language that is specifically designed to have as few
implementation dependencies as possible. It is intended to let application
developers "write once, run anywhere" (WORA), meaning that code that
runs on one platform does not need to be recompiled to run on another.
Java is as of 2012 one of the most popular programming languages in use,
particularly for client-server web applications, with a reported 10 million
user.
MySql Tables :
1.Package Table:
2.Register Table:
3.Temp Table:
4.Temp2 Table:
Main Page Form Design
Main Page Form Code
Admin Button:-
private void
AdminButtonActionPerformed(java.awt.event.ActionEvent evt) {
// Adminform
Admin a=new Admin()
dispose();
a.show();
}
Register Button:-
private void
RegisterButtonActionPerformed(java.awt.event.ActionEvent evt) {
// Registration Form
Registration a=new Registration();
dispose();
a.show();
}
Book Tickets Button:-
private void
BookTicketsButtonActionPerformed(java.awt.event.ActionEvent evt)
{
// TicketsForm
tickets a=new tickets();
dispose();
a.show();
}
Update Booking Button:-
private void
UpdateBookingButtonActionPerformed(java.awt.event.ActionEvent
evt) {
// UserSign Form
UserSign a=new UserSign();
dispose();
a.show();
}
Admin Login form Design
Admin Login form Code
Imports:-
import javax.swing.JOptionPane;
SignIn Button:-
private void
SignInButtonActionPerformed(java.awt.event.ActionEvent evt) {
// Id And Password Validation Code
String s=jTextField1.getText();
String d=jPasswordField1.getText().toString();
if(s.equals("Hallmark") && d.equals("abc"))
{
JOptionPane.showMessageDialog(null,"Logged In
Successfully");
Adminform a=new Adminform();
dispose();
a.show();
}
else
{
JOptionPane.showMessageDialog(null,"Incorrect Username Or
PassWord","Hallmark Tours &
Travels",JOptionPane.ERROR_MESSAGE);
}
Back Button:-
private void
BackButtonActionPerformed(java.awt.event.ActionEvent evt) {
// Back To Main Form
Main a=new Main();
dispose();
a.show();
}
Admin Form Design
Admin Form Code
private void formWindowOpened(java.awt.event.WindowEvent evt)
{
// Code for Label Show 'Hi' Message
jLabel1.setText("Hi Admin");
}
Add Package Button:-
private void
AddPackageButtonActionPerformed(java.awt.event.ActionEvent evt)
{
// AddPackage Form
AddPackage a=new AddPackage();
dispose();
a.show();
}
Remove Package Button:-
private void
RemovePackageButtonActionPerformed(java.awt.event.ActionEvent
evt) {
// Remove Package Form
removePackage b=new removePackage();
dispose();
b.show();
}
Modify Package Button:-
private void
ModifyPackageButtonActionPerformed(java.awt.event.ActionEvent
evt) {
// Modify Package Form
ModifyPackage a=new ModifyPackage();
dispose();
a.show();
}
View Booking Button:-
private void
ViewBookingButtonActionPerformed(java.awt.event.ActionEvent
evt) {
// View User Booking Form
viewbooking a=new viewbooking();
dispose();
a.show();
}
View User Booking:
private void
ViewUserButtonActionPerformed(java.awt.event.ActionEvent evt) {
// View User Form
ViewUser a=new ViewUser();
dispose();
a.show();
}
Sign Out Button:-
private void
SignOutButtonActionPerformed(java.awt.event.ActionEvent evt) {
// Main Form Form
Main a=new Main();
dispose();
a.show();
}
Add Package Form Design
Add Package Form Code
Imports:-
import java.sql.*;
import javax.swing.JOptionPane;
import javax.swing.ImageIcon;
Connection con;
Statement st;
ResultSet rs;
String query;
private void formWindowOpened(java.awt.event.WindowEvent
evt) {
// Connection Code
try{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour
s","root","");
st=con.createStatement();
rs=st.executeQuery("Select * from package;");
}
catch(Exception e){
System.out.print(e.toString());
}
}
Add Button:-
private void
AddPackageButtonActionPerformed(java.awt.event.ActionEvent evt)
{
// Insert Package Code
try{
query="Insert into package
values('"+jTextField1.getText()+"','"+jTextField2.getText()+"','"+jTextAr
ea1.getText()+"',"+adult.getText()+","+child.getText()+");";
st.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Package Added
Successfully");
}
catch(Exception e){
System.out.print(e.toString());
}
}
Back Button:-
private void jButton2ActionPerformed(java.awt.event.ActionEvent
evt) {
// Back To AdminForm
Adminform a=new Adminform();
dispose();
a.show();
}
Remove Package Form Design
Remove Package Form Code
Imports:-
import java.sql.*;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
Connection con;
Statement st;
ResultSet rs;
String query;
private void formWindowOpened(java.awt.event.WindowEvent evt)
{
// Connection Code & Add Item In List
try{
DefaultListModel d=(DefaultListModel)jList1.getModel();
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour
s","root","");
st=con.createStatement();
rs=st.executeQuery("Select * from package;");
while(rs.next()){
d.addElement(rs.getString(1));
}
}
catch(Exception e){
System.out.print(e.toString());
}
}
Remove Button:-
private void
RemoveButtonActionPerformed(java.awt.event.ActionEvent evt) {
// Delete Package Code
try{
query="delete from package where
title='"+jList1.getSelectedValue()+"';";
st.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Removed
Successfully");
}
catch(Exception e)
{
System.out.print(e.toString());
}
}
Back Button:-
private void jButton2ActionPerformed(java.awt.event.ActionEvent
evt) {
// AdminForm
Adminform a=new Adminform();
dispose();
a.show();
}
Modify Package Form Design
Modify Package Form Code
Imports:-
import java.sql.*;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
Connection con;
Statement st;
ResultSet rs;
String query;
private void formWindowOpened(java.awt.event.WindowEvent evt)
{
// Connection Code && Adding Package In List Code
try{
DefaultListModel d=(DefaultListModel)jList1.getModel();
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour
s","root","");
st=con.createStatement();
rs=st.executeQuery("Select * from package;");
while(rs.next()){
d.addElement(rs.getString(1));
}
}
catch(Exception e){
System.out.print(e.toString());
}
}
private void
jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) {
// Retrieve Data from Table
String s=(String) jList1.getSelectedValue();
try{
rs=st.executeQuery("Select * from package where Title='"+s+"';");
while(rs.next()){
jTextField1.setText(rs.getString(1));
jTextField2.setText(rs.getString(2));
jTextArea1.setText(rs.getString(3));
child.setText(rs.getString(5));
adult.setText(rs.getString(4));
}
}
catch(Exception e){
System.out.print(e.toString());
}
}
Update Button:-
private void
UpdateButtonActionPerformed(java.awt.event.ActionEvent evt) {
// Update Code
try{
String s=(String) jList1.getSelectedValue();
query="update package set
image='"+jTextField2.getText()+"',info='"+jTextArea1.getText()+"',PAd
ult="+adult.getText()+",PChild="+child.getText()+" where
title='"+s+"';";
st.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Updated Successfully");
}
catch(Exception e){
System.out.print(e.toString());
}
}
Back Button
private void
BackButtonActionPerformed(java.awt.event.ActionEvent evt) {
// AdminForm
Adminform a=new Adminform();
dispose();
a.show();
}
View Booking Form Design
View Booking Form Code
Imports:
import javax.swing.table.DefaultTableModel;
import java.sql.*;
Connection con;
Statement st;
ResultSet rs;
String query;
private void formWindowOpened(java.awt.event.WindowEvent evt)
{
// Connection Code && Adding Rows in Table
DefaultTableModel
model1=(DefaultTableModel)jTable1.getModel();
try{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour
s","root","");
st=con.createStatement();
rs=st.executeQuery("Select * from booking;");
while(rs.next()){
model1.addRow(new
Object[]{rs.getString(1),rs.getString(4),rs.getString(2),rs.getString(3
),rs.getString(5)});
}
}
catch(Exception e){
System.out.print(e.toString());
}
}
Back Button:-
private void jButton1ActionPerformed(java.awt.event.ActionEvent
evt) {
// Admin Form
Adminform a=new Adminform();
dispose();
a.show();
}
View Users Form Design
View Users Form Code
Import:
import java.sql.*;
import javax.swing.table.*;
Connection con;
Statement st;
ResultSet rs;
String query;
private void formWindowOpened(java.awt.event.WindowEvent evt)
{
// Connection Code && Adding Rows in Table
DefaultTableModel
model1=(DefaultTableModel)jTable1.getModel();
try{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour
s","root","");
st=con.createStatement();
rs=st.executeQuery("Select * from register;");
while(rs.next()){
model1.addRow(new
Object[]{rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4
),rs.getString(9),rs.getString(10)});
}
}
catch(Exception e){
System.out.print(e.toString());
}
}
Back Button:-
private void jButton2ActionPerformed(java.awt.event.ActionEvent
evt) {
// Admin Form
Adminform a=new Adminform();
dispose();
a.show();
}
Register Form Design
Register Form Code
Imports:
import java.sql.*;
import javax.swing.JOptionPane;
Objects:
Connection con;
Statement st;
ResultSet rs;
String query;
private void formWindowOpened(java.awt.event.WindowEvent evt)
{
// ConnectionCode
try{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour
s","root","");
st=con.createStatement();
rs=st.executeQuery("Select * from register;");
}
catch(Exception e){
System.out.print(e.toString());
}
}
Register Button:-
private void jButton1ActionPerformed(java.awt.event.ActionEvent
evt) {
// Inserting Registered Users Code
String s;
if(jRadioButton1.isSelected()==true)
{
s="Male";
}
else
s="Female";
try{
query="Insert into register
values('"+jTextField1.getText()+"','"+jTextField2.getText()+"','"+jTextFie
ld3.getText()+"','"+s+"','"+jTextField4.getText()+"','"+jPasswordField1.ge
tText().toString()+"','"+jTextField5.getText()+"','"+jTextField6.getText
()+"',"+jTextField7.getText()+",'"+jTextField8.getText()+"');";
st.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Registered Successfully");
}
catch(Exception e){
System.out.print(e.toString());
}
}
Back Button
private void jButton2ActionPerformed(java.awt.event.ActionEvent
evt) {
// MainForm
Main a=new Main();
dispose();
a.show();
}
Book Tickets Form Design
Book Tickets Form Code
Imports:
import java.sql.*;
import javax.swing.ImageIcon;
import javax.swing.DefaultListModel;
Connection con;
Statement st;
ResultSet rs;
String query;
private void formWindowOpened(java.awt.event.WindowEvent evt)
{
// Connection Code && Adding Package In LIst
try{
DefaultListModel d=(DefaultListModel)jList1.getModel();
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour
s","root","");
st=con.createStatement();
rs=st.executeQuery("Select * from package;");
while(rs.next()){
d.addElement(rs.getString(1));
}
}
catch(Exception e){
System.out.print(e.toString());
}
}
private void
jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) {
// Setting Image And Desc In TextArea
String a=jList1.getSelectedValue().toString();
try{
rs=st.executeQuery("Select * from package where
title='"+jList1.getSelectedValue()+"';");
if(rs.next()){
jTextArea1.setText(rs.getString(3));
jLabel1.setIcon(new ImageIcon(""+rs.getString(2)));
}
}
catch(Exception e){
System.out.print(e.toString());
}
}
Book Tickets Button:
private void jButton1ActionPerformed(java.awt.event.ActionEvent
evt) {
// Inserting into Temporary Table && Book Form
try{
String a=(String) jList1.getSelectedValue();
query="Insert into temp2 values('"+a+"');";
st.executeUpdate(query);
}
catch(Exception e){
System.out.print(e.toString());
}
book a=new book();
dispose();
a.show();
}
Back Button:-
private void jButton2ActionPerformed(java.awt.event.ActionEvent
evt) {
// Main Form
Main a=new Main();
dispose();
a.show();
}
Booking Form Design
Booking Form Code
Imports:-
import java.sql.*;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
Connection con;
Statement st;
ResultSet rs;
ResultSet rs1;
String query;
Global Variables:
// Global Variables
int b;int c; double tot;
private void formWindowOpened(java.awt.event.WindowEvent evt)
{
// Connection Code && Setting Image In Label
jPanel3.setVisible(false);
try{
String s = null;
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour
s","root","");
st=con.createStatement();
rs=st.executeQuery("Select * from temp2;");
while(rs.next()){
s=rs.getString(1);
}
rs1=st.executeQuery("Select * from package where title =
'"+s+"'");
while(rs1.next()){
String a=rs1.getString(1);
adu.setText(rs1.getString(4));
chi.setText(rs1.getString(5));
img.setIcon(new ImageIcon(""+rs1.getString(2)));
jLabel7.setText("Your Package"+" - "+a);
}
}
catch(Exception e){
System.out.print(e.toString());
}
}
Book Ticket Button:-
private void
jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// Userid Validation Code
String s=jTextField1.getText();
try{
query="Select * from register where username='"+s+"';";
rs=st.executeQuery(query);
if(rs.next())
{
jPanel3.setVisible(true);
}
else {
b=JOptionPane.showConfirmDialog(null,"Invalid Id Or"+"
Registration Required"+" Click on Yes to Register If not a
Member");
{
if(b==JOptionPane.YES_OPTION){
Registration w=new Registration();
dispose();
w.show();
}
}
}
}
catch(Exception e){
System.out.println(e);
}
}
Book Ticket:-
private void jButton2ActionPerformed(java.awt.event.ActionEvent
evt) {
// Calculation & Booking Code
String s=null;
b=Integer.parseInt(child.getText());
c=Integer.parseInt(adult.getText());
String d=jTextField1.getText();
double ch=0;double ad=0;
int x=Integer.parseInt(chi.getText());
int y=Integer.parseInt(adu.getText());
b=Integer.parseInt(child.getText());
c=Integer.parseInt(adult.getText());
if(b<0)
{ JOptionPane.showMessageDialog(null,"Error
Negative Value Invalid");
}
if(c<0)
{ JOptionPane.showMessageDialog(null,"Error
Negative Value Invalid");
}
ch=x*b;
ad=y*c;
tot=ch+ad;
amt.setText(""+tot);
try{
rs=st.executeQuery("Select * from temp2;");
while(rs.next()){
s=rs.getString(1);
}
query="Insert into booking
values('"+s+"',"+b+","+c+",'"+d+"','"+date.getText()+"',"+tot+");";
st.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Booked Successfully");
st.executeUpdate("delete from temp2;");
}
catch(Exception e){
System.out.print(e.toString());
}
}
Home Button:-
private void jButton4ActionPerformed(java.awt.event.ActionEvent
evt) {
// Main Form
Main a=new Main();
dispose();
a.show();
}
Users Login Form Design
Users Login Form Code
Imports:
import java.sql.*;
import javax.swing.JOptionPane;
Connection con;
Statement st;
ResultSet rs;
String query;
private void formWindowOpened(java.awt.event.WindowEvent
evt) {
//Connection Code
try{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour
s","root","");
st=con.createStatement();
}
catch(Exception e){
System.out.print(e.toString());
}
}
Sign In Button:
private void jButton2ActionPerformed(java.awt.event.ActionEvent
evt) {
//User Validation Code
String a;
a=jTextField1.getText();int b = 0;
try{
rs=st.executeQuery("Select * from register where
UserName='"+a+"';");
if(rs.next()){
query="Insert into temp values('"+a+"');";
st.executeUpdate(query);
Users w=new Users();
dispose();
w.show();
}
else {
b=JOptionPane.showConfirmDialog(null,"Invalid Id Or"+"
Registration Required"+" Click on Yes to Register If not a
Member");
{
if(b==JOptionPane.YES_OPTION) {
Registration w=new Registration();
dispose();
w.show();
}
}
}
}
catch(Exception e){
System.out.print(e.toString());
}
}
Back Button:
private void
jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
// Main Form
Main a=new Main();
dispose();
a.show();
}
Users Form Design
Users Form Code
View Booking Button:
private void jButton4ActionPerformed(java.awt.event.ActionEvent
evt) {
// UserViewBook Form
UserViewBook l=new UserViewBook();
dispose();
l.show();
}
Cancel Booking Button:
private void jButton3ActionPerformed(java.awt.event.ActionEvent
evt) {
// CancelBooking Form
CancelBooking q=new CancelBooking();
dispose();
q.show();
}
Update Booking:
private void jButton1ActionPerformed(java.awt.event.ActionEvent
evt) {
//Update Booking Form
UpdateBook e=new UpdateBook();
dispose();
e.show();
}
Sign Out Button:
private void
jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
// Signout Form && Deletion from temperory table
try{
st.executeUpdate("delete from temp;");
UserSign z=new UserSign();
dispose();
z.show();
}
catch(Exception e){
System.out.print(e.toString());
}
}
User View Booking Form Design
User View Booking Form Code
Imports
import java.sql.*;
import javax.swing.table.DefaultTableModel;
Connection con;
Statement st;
ResultSet rs;
ResultSet rs1;
String query;
private void formWindowOpened(java.awt.event.WindowEvent evt)
{
// Adding Booking Information In Table & Connection Code
DefaultTableModel
model1=(DefaultTableModel)jTable1.getModel();
Try {
String s = null;
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour
s","root","");
st=con.createStatement();
rs=st.executeQuery("Select * from temp;");
while(rs.next()){
s=rs.getString(1);
jLabel1.setText("Hi"+" "+s+",");
}
rs1=st.executeQuery("Select * from booking where Username
= '"+s+"'");
while(rs1.next()){
model1.addRow(new
Object[]{rs1.getString(1),rs1.getString(2),rs1.getString(3),rs1.getString
(5),rs1.getString(6)});
}
}
catch(Exception e){
System.out.print(e.toString());
} }
Back Button:
private void jButton1ActionPerformed(java.awt.event.ActionEvent
evt) {
// User Form
Users a=new Users();
dispose();
a.show();
}
Cancel Booking Form Design
Cancel Booking Form Code
Imports:
import java.sql.*;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
Connection con;
Statement st;
ResultSet rs;
ResultSet rs1;
String query;
private void formWindowOpened(java.awt.event.WindowEvent evt)
{
// Connection Code && Adding Items In List Code
try{
String s = null;
DefaultListModel d=(DefaultListModel)jList1.getModel();
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour
s","root","");
st=con.createStatement();
rs1=st.executeQuery("Select * from temp;");
while(rs1.next()){
s=rs1.getString(1);
jLabel1.setText("Hi"+" "+s+",");
}
rs=st.executeQuery("Select Pname from booking where
Username='"+s+"';");
while(rs.next()){
d.addElement(rs.getString(1));
}
}
catch(Exception e){
System.out.print(e.toString());
}
}
Cancel Button:
private void
CancelButtonActionPerformed(java.awt.event.ActionEvent evt) {
// Delete Booking Code
try{
query="delete from booking where
Pname='"+jList1.getSelectedValue()+"';";
st.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Removed Successfully");
} catch(Exception e) {
System.out.print(e.toString());
}
}
Back Button:
private void
BackButtonActionPerformed(java.awt.event.ActionEvent evt) {
//Users Form
Users a=new Users();
dispose();
a.show();
}
User Update Booking Form Design
User Update Booking Form Code
Imports:
import java.sql.*;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
Connection con;
Statement st;
ResultSet rs;
ResultSet rs1;
ResultSet rs2;
String query;
private void formWindowOpened(java.awt.event.WindowEvent
evt) {
//Connection Code && List Code
try{
String s = null;
DefaultListModel d=(DefaultListModel)jList1.getModel();
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour
s","root","");
st=con.createStatement();
rs1=st.executeQuery("Select * from temp;");
while(rs1.next()){
s=rs1.getString(1);
jLabel8.setText("Hi"+" "+s+",");
}
rs=st.executeQuery("Select Pname from booking where
Username='"+s+"';");
while(rs.next()){
d.addElement(rs.getString(1));
}
}
catch(Exception e){
System.out.print(e.toString());
}
}
private void
jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) {
//Package Selection Code
String s=(String) jList1.getSelectedValue();
String j=null;
try{
rs2=st.executeQuery("Select * from temp;");
while(rs2.next()){
j=rs2.getString(1);
}
rs=st.executeQuery("Select * from booking where
Pname='"+s+"'&& Username='"+j+"';");
while(rs.next()){
adult.setText(rs.getString(3));
child.setText(rs.getString(2));
date.setText(rs.getString(5));
tot.setText(rs.getString(6));
}
rs1=st.executeQuery("Select * from package where
Title='"+s+"';");
while(rs1.next()){
adu.setText(rs1.getString(4));
chi.setText(rs1.getString(5));
}
}
catch(Exception e){
System.out.print(e.toString());
}
}
Calculate Button
private void jButton1ActionPerformed(java.awt.event.ActionEvent
evt) {
//Calculation Code
int a=Integer.parseInt(child.getText());
int b=Integer.parseInt(adult.getText());
int c=Integer.parseInt(adu.getText());
int d=Integer.parseInt(chi.getText());
if(a<0 && b<0)
{
JOptionPane.showMessageDialog(null,"Please Enter Valid
Number");
}
if(a<0 || b<0)
{ JOptionPane.showMessageDialog(null,"Please Enter
Valid Number");
}
double s=a*d;
double j=b*c;
double x=s+j;
tot.setText(""+x);
}
Update Button:
private void jButton2ActionPerformed(java.awt.event.ActionEvent
evt) {
// Update Code
try{
String s=null;
rs1=st.executeQuery("Select * from temp;");
while(rs1.next()){
s=rs1.getString(1);
}
query="update booking set
child='"+child.getText()+"',adult='"+adult.getText()+"',date='"+date.get
Text()+"',total="+tot.getText()+" where Username='"+s+"';";
st.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Updated Successfully");
}
catch(Exception e){
System.out.print(e.toString());
}
}
Back Button:
private void jButton3ActionPerformed(java.awt.event.ActionEvent
evt) {
//Users Form
Users a=new Users();
dispose();
a.show();
}
Bibliography
 WWW.Google.com
 Informatics Practices for Class 11 - Sumita Arora.
Informatics Practices for Class 12 - Sumita Arora

More Related Content

What's hot

Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Self-employed
 
computer science project on movie booking system
computer science project on movie booking systemcomputer science project on movie booking system
computer science project on movie booking systemAnurag Yadav
 
Social Media Site User Management System Class 12th Informatics Practices Pyt...
Social Media Site User Management System Class 12th Informatics Practices Pyt...Social Media Site User Management System Class 12th Informatics Practices Pyt...
Social Media Site User Management System Class 12th Informatics Practices Pyt...deboshreechatterjee2
 
Library Management Project (computer science) class 12
Library Management Project (computer science) class 12Library Management Project (computer science) class 12
Library Management Project (computer science) class 12RithuJ
 
Library Management Python, MySQL
Library Management Python, MySQLLibrary Management Python, MySQL
Library Management Python, MySQLDarshit Vaghasiya
 
Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12OmRanjan2
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingHarsh Kumar
 
Physics Practical File - with Readings | Class 12 CBSE
Physics Practical File - with Readings | Class 12 CBSEPhysics Practical File - with Readings | Class 12 CBSE
Physics Practical File - with Readings | Class 12 CBSESaksham Mittal
 
English ASL Project Work - The Enemy - The Conflict of Human Emotions
English ASL Project Work - The Enemy - The Conflict of Human EmotionsEnglish ASL Project Work - The Enemy - The Conflict of Human Emotions
English ASL Project Work - The Enemy - The Conflict of Human EmotionsHarlincoln Singh Thandi
 
IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbsesiddharthjha34
 
Presence Of Oxalate Ions In Guava
Presence Of Oxalate Ions In Guava Presence Of Oxalate Ions In Guava
Presence Of Oxalate Ions In Guava adharshvg
 
Python Project On Cosmetic Shop system
Python Project On Cosmetic Shop systemPython Project On Cosmetic Shop system
Python Project On Cosmetic Shop systemvikram mahendra
 
CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL Rishabh-Rawat
 
Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)lokesh meena
 
Bhakti Movements History Investigatory Project
Bhakti Movements History Investigatory ProjectBhakti Movements History Investigatory Project
Bhakti Movements History Investigatory ProjectSaksham Mittal
 
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...ArkaSarkar23
 
Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdfHarshitSachdeva17
 
cbse 12th chemistry investigatory project
cbse 12th chemistry investigatory project cbse 12th chemistry investigatory project
cbse 12th chemistry investigatory project NIKHIL DWIVEDI
 
TOPIC-To investigate the relation between the ratio of :- 1. Input and outpu...
TOPIC-To investigate the relation between the ratio of :-1. Input and outpu...TOPIC-To investigate the relation between the ratio of :-1. Input and outpu...
TOPIC-To investigate the relation between the ratio of :- 1. Input and outpu...CHMURLIDHAR
 

What's hot (20)

Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12
 
computer science project on movie booking system
computer science project on movie booking systemcomputer science project on movie booking system
computer science project on movie booking system
 
Social Media Site User Management System Class 12th Informatics Practices Pyt...
Social Media Site User Management System Class 12th Informatics Practices Pyt...Social Media Site User Management System Class 12th Informatics Practices Pyt...
Social Media Site User Management System Class 12th Informatics Practices Pyt...
 
Library Management Project (computer science) class 12
Library Management Project (computer science) class 12Library Management Project (computer science) class 12
Library Management Project (computer science) class 12
 
Library Management Python, MySQL
Library Management Python, MySQLLibrary Management Python, MySQL
Library Management Python, MySQL
 
Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market Billing
 
Physics Practical File - with Readings | Class 12 CBSE
Physics Practical File - with Readings | Class 12 CBSEPhysics Practical File - with Readings | Class 12 CBSE
Physics Practical File - with Readings | Class 12 CBSE
 
English ASL Project Work - The Enemy - The Conflict of Human Emotions
English ASL Project Work - The Enemy - The Conflict of Human EmotionsEnglish ASL Project Work - The Enemy - The Conflict of Human Emotions
English ASL Project Work - The Enemy - The Conflict of Human Emotions
 
IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbse
 
Presence Of Oxalate Ions In Guava
Presence Of Oxalate Ions In Guava Presence Of Oxalate Ions In Guava
Presence Of Oxalate Ions In Guava
 
Python Project On Cosmetic Shop system
Python Project On Cosmetic Shop systemPython Project On Cosmetic Shop system
Python Project On Cosmetic Shop system
 
CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL
 
Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)
 
ASL/ALS CLASS 12 ENGLISH PROJECT
ASL/ALS CLASS 12 ENGLISH PROJECTASL/ALS CLASS 12 ENGLISH PROJECT
ASL/ALS CLASS 12 ENGLISH PROJECT
 
Bhakti Movements History Investigatory Project
Bhakti Movements History Investigatory ProjectBhakti Movements History Investigatory Project
Bhakti Movements History Investigatory Project
 
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
 
Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdf
 
cbse 12th chemistry investigatory project
cbse 12th chemistry investigatory project cbse 12th chemistry investigatory project
cbse 12th chemistry investigatory project
 
TOPIC-To investigate the relation between the ratio of :- 1. Input and outpu...
TOPIC-To investigate the relation between the ratio of :-1. Input and outpu...TOPIC-To investigate the relation between the ratio of :-1. Input and outpu...
TOPIC-To investigate the relation between the ratio of :- 1. Input and outpu...
 

Similar to Informatics Practices Project on Tour and travels

Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Iakiv Kramarenko
 
]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3Klaus Hofeditz
 
computerscience-170129081612.pdf
computerscience-170129081612.pdfcomputerscience-170129081612.pdf
computerscience-170129081612.pdfKiranKumari204016
 
Final report mobile shop
Final report   mobile shopFinal report   mobile shop
Final report mobile shopViditsingh22
 
How to disassemble one monster app into an ecosystem of 30
How to disassemble one monster app into an ecosystem of 30How to disassemble one monster app into an ecosystem of 30
How to disassemble one monster app into an ecosystem of 30fiyuer
 
Week 8
Week 8Week 8
Week 8A VD
 
How to write you first class in c++ object oriented programming
How to write you first class in c++ object oriented programmingHow to write you first class in c++ object oriented programming
How to write you first class in c++ object oriented programmingSyed Faizan Hassan
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4Javier Eguiluz
 
Laravel 8 export data as excel file with example
Laravel 8 export data as excel file with exampleLaravel 8 export data as excel file with example
Laravel 8 export data as excel file with exampleKaty Slemon
 
A comprehensive guide on developing responsive and common react filter component
A comprehensive guide on developing responsive and common react filter componentA comprehensive guide on developing responsive and common react filter component
A comprehensive guide on developing responsive and common react filter componentKaty Slemon
 
A short tale about state machine
A short tale about state machineA short tale about state machine
A short tale about state machineŁukasz Chruściel
 
Multilingualism makes better programmers
Multilingualism makes better programmersMultilingualism makes better programmers
Multilingualism makes better programmersAlexander Varwijk
 
09 01 tasks
09 01 tasks09 01 tasks
09 01 taskstflung
 

Similar to Informatics Practices Project on Tour and travels (20)

Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
 
]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3
 
computerscience-170129081612.pdf
computerscience-170129081612.pdfcomputerscience-170129081612.pdf
computerscience-170129081612.pdf
 
Lightning Talk - Xamarin
Lightning Talk - Xamarin Lightning Talk - Xamarin
Lightning Talk - Xamarin
 
DrupalCon jQuery
DrupalCon jQueryDrupalCon jQuery
DrupalCon jQuery
 
Final report mobile shop
Final report   mobile shopFinal report   mobile shop
Final report mobile shop
 
How to disassemble one monster app into an ecosystem of 30
How to disassemble one monster app into an ecosystem of 30How to disassemble one monster app into an ecosystem of 30
How to disassemble one monster app into an ecosystem of 30
 
Week 8
Week 8Week 8
Week 8
 
Ip bus Akshay
Ip bus AkshayIp bus Akshay
Ip bus Akshay
 
How to write you first class in c++ object oriented programming
How to write you first class in c++ object oriented programmingHow to write you first class in c++ object oriented programming
How to write you first class in c++ object oriented programming
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4
 
Laravel 8 export data as excel file with example
Laravel 8 export data as excel file with exampleLaravel 8 export data as excel file with example
Laravel 8 export data as excel file with example
 
Hexagonal architecture
Hexagonal architectureHexagonal architecture
Hexagonal architecture
 
A comprehensive guide on developing responsive and common react filter component
A comprehensive guide on developing responsive and common react filter componentA comprehensive guide on developing responsive and common react filter component
A comprehensive guide on developing responsive and common react filter component
 
Extend sdk
Extend sdkExtend sdk
Extend sdk
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
 
A short tale about state machine
A short tale about state machineA short tale about state machine
A short tale about state machine
 
Multilingualism makes better programmers
Multilingualism makes better programmersMultilingualism makes better programmers
Multilingualism makes better programmers
 
09 01 tasks
09 01 tasks09 01 tasks
09 01 tasks
 
Visual Basic(VB)
Visual Basic(VB)Visual Basic(VB)
Visual Basic(VB)
 

More from Harsh Mathur

Understanding-Salesforce-CDP.pdf
Understanding-Salesforce-CDP.pdfUnderstanding-Salesforce-CDP.pdf
Understanding-Salesforce-CDP.pdfHarsh Mathur
 
Service Desk By Harsh Mathur
Service Desk  By Harsh MathurService Desk  By Harsh Mathur
Service Desk By Harsh MathurHarsh Mathur
 
Training Management Software By Harsh Mathur.
Training  Management Software By Harsh Mathur.Training  Management Software By Harsh Mathur.
Training Management Software By Harsh Mathur.Harsh Mathur
 
Harsh Mathur Final Year Project Report on Restaurant Billing System
Harsh  Mathur Final Year Project Report on Restaurant Billing SystemHarsh  Mathur Final Year Project Report on Restaurant Billing System
Harsh Mathur Final Year Project Report on Restaurant Billing SystemHarsh Mathur
 
Hotel management system By Harsh & aditya Mathur.
Hotel management system By  Harsh & aditya  Mathur.Hotel management system By  Harsh & aditya  Mathur.
Hotel management system By Harsh & aditya Mathur.Harsh Mathur
 
Harsh Mathur Restaurant Billing System project ppt
Harsh Mathur Restaurant Billing System project pptHarsh Mathur Restaurant Billing System project ppt
Harsh Mathur Restaurant Billing System project pptHarsh Mathur
 
Invoice Maker by harsh mathur
Invoice Maker by harsh mathurInvoice Maker by harsh mathur
Invoice Maker by harsh mathurHarsh Mathur
 
Holography project By Harsh Mathur & Aditya Mathur.
Holography project By Harsh Mathur & Aditya Mathur.Holography project By Harsh Mathur & Aditya Mathur.
Holography project By Harsh Mathur & Aditya Mathur.Harsh Mathur
 
Harsh Mathur project c++
Harsh Mathur project c++Harsh Mathur project c++
Harsh Mathur project c++Harsh Mathur
 
College website By Harsh Mathur
College website By Harsh MathurCollege website By Harsh Mathur
College website By Harsh MathurHarsh Mathur
 
Billing software By Harsh Mathur
Billing software By Harsh MathurBilling software By Harsh Mathur
Billing software By Harsh MathurHarsh Mathur
 
Alert system By Harsh Mathur.
Alert system By Harsh Mathur.Alert system By Harsh Mathur.
Alert system By Harsh Mathur.Harsh Mathur
 
Color palette By Harsh Mathur
Color palette By Harsh MathurColor palette By Harsh Mathur
Color palette By Harsh MathurHarsh Mathur
 
Billing Software By Harsh Mathur.
Billing Software By Harsh Mathur.Billing Software By Harsh Mathur.
Billing Software By Harsh Mathur.Harsh Mathur
 
Text Editor By Harsh Mathur.
Text Editor By Harsh Mathur.Text Editor By Harsh Mathur.
Text Editor By Harsh Mathur.Harsh Mathur
 
Student Management System (SMS)
Student Management System (SMS)Student Management System (SMS)
Student Management System (SMS)Harsh Mathur
 
Cab invoice/cab Bill Genrater
Cab invoice/cab Bill GenraterCab invoice/cab Bill Genrater
Cab invoice/cab Bill GenraterHarsh Mathur
 
Informatics Practices Chapter 2 Open Source Software Concepts Class 12th
 Informatics Practices Chapter 2  Open Source Software Concepts Class 12th Informatics Practices Chapter 2  Open Source Software Concepts Class 12th
Informatics Practices Chapter 2 Open Source Software Concepts Class 12thHarsh Mathur
 
Chapter 1 computer networking Class 12th
Chapter 1 computer networking Class 12thChapter 1 computer networking Class 12th
Chapter 1 computer networking Class 12thHarsh Mathur
 
Eco chapter 1 class 12th
Eco chapter 1 class 12thEco chapter 1 class 12th
Eco chapter 1 class 12thHarsh Mathur
 

More from Harsh Mathur (20)

Understanding-Salesforce-CDP.pdf
Understanding-Salesforce-CDP.pdfUnderstanding-Salesforce-CDP.pdf
Understanding-Salesforce-CDP.pdf
 
Service Desk By Harsh Mathur
Service Desk  By Harsh MathurService Desk  By Harsh Mathur
Service Desk By Harsh Mathur
 
Training Management Software By Harsh Mathur.
Training  Management Software By Harsh Mathur.Training  Management Software By Harsh Mathur.
Training Management Software By Harsh Mathur.
 
Harsh Mathur Final Year Project Report on Restaurant Billing System
Harsh  Mathur Final Year Project Report on Restaurant Billing SystemHarsh  Mathur Final Year Project Report on Restaurant Billing System
Harsh Mathur Final Year Project Report on Restaurant Billing System
 
Hotel management system By Harsh & aditya Mathur.
Hotel management system By  Harsh & aditya  Mathur.Hotel management system By  Harsh & aditya  Mathur.
Hotel management system By Harsh & aditya Mathur.
 
Harsh Mathur Restaurant Billing System project ppt
Harsh Mathur Restaurant Billing System project pptHarsh Mathur Restaurant Billing System project ppt
Harsh Mathur Restaurant Billing System project ppt
 
Invoice Maker by harsh mathur
Invoice Maker by harsh mathurInvoice Maker by harsh mathur
Invoice Maker by harsh mathur
 
Holography project By Harsh Mathur & Aditya Mathur.
Holography project By Harsh Mathur & Aditya Mathur.Holography project By Harsh Mathur & Aditya Mathur.
Holography project By Harsh Mathur & Aditya Mathur.
 
Harsh Mathur project c++
Harsh Mathur project c++Harsh Mathur project c++
Harsh Mathur project c++
 
College website By Harsh Mathur
College website By Harsh MathurCollege website By Harsh Mathur
College website By Harsh Mathur
 
Billing software By Harsh Mathur
Billing software By Harsh MathurBilling software By Harsh Mathur
Billing software By Harsh Mathur
 
Alert system By Harsh Mathur.
Alert system By Harsh Mathur.Alert system By Harsh Mathur.
Alert system By Harsh Mathur.
 
Color palette By Harsh Mathur
Color palette By Harsh MathurColor palette By Harsh Mathur
Color palette By Harsh Mathur
 
Billing Software By Harsh Mathur.
Billing Software By Harsh Mathur.Billing Software By Harsh Mathur.
Billing Software By Harsh Mathur.
 
Text Editor By Harsh Mathur.
Text Editor By Harsh Mathur.Text Editor By Harsh Mathur.
Text Editor By Harsh Mathur.
 
Student Management System (SMS)
Student Management System (SMS)Student Management System (SMS)
Student Management System (SMS)
 
Cab invoice/cab Bill Genrater
Cab invoice/cab Bill GenraterCab invoice/cab Bill Genrater
Cab invoice/cab Bill Genrater
 
Informatics Practices Chapter 2 Open Source Software Concepts Class 12th
 Informatics Practices Chapter 2  Open Source Software Concepts Class 12th Informatics Practices Chapter 2  Open Source Software Concepts Class 12th
Informatics Practices Chapter 2 Open Source Software Concepts Class 12th
 
Chapter 1 computer networking Class 12th
Chapter 1 computer networking Class 12thChapter 1 computer networking Class 12th
Chapter 1 computer networking Class 12th
 
Eco chapter 1 class 12th
Eco chapter 1 class 12thEco chapter 1 class 12th
Eco chapter 1 class 12th
 

Recently uploaded

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 

Recently uploaded (20)

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

Informatics Practices Project on Tour and travels

  • 1. INFORMATICS PRACTICES PROJECT FILE ON “TOUR AND TRAVELS MANAGEMNET” Submitedto:Sir HimanshuSingh MadeBy:Harsh Verma Mathur
  • 2. Certificate This is to certify that Harsh Mathur of Class 12(Comm) Exam Number ___________has successfully completed his assignment work in INFORMATICS PRACTICES for the term ending in year 2015- 2016. ______________ _______________ Sign of Teacher Sign of Principal _______________ _______________ Sign of Examiner School Stamp Acknowledgement
  • 3. I express all my sincere thanks to my institution Maharaja agrasen public school for providing necessary facilities which were required for the completion of this assignment. I also acknowledge the support received from the i.p teacher Sir himanshu singh verma. Without their help, Guidance and support it could have been impossible to complete this assignment. Lastly I would thank the Principal of our School meena sharma for providing an opportunity to initiate ourselves with these kind of assignment.
  • 4. Need & Scope of the Project This project has a wider scope in future and can be helpful to many.Since this project is made in java and mysql which makes this project wonder and innovative and helps in clearing the concept of java and mysql. This project also clears the relationship between java and mysql.This also shows how java and mysql are connected together in an application.This project can be needed in future for tour & travel and also this project can be helpful to tour which deal with their transaction online on a regular basis.
  • 5. JAVA Java is a programming language originally developed by James Gosling at Sun Microsystems (which has since merged into Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++, but it has fewerlow-level facilities than either of them. Java applications are typically compiled to bytecode (class file) that can run on any Java virtual machine (JVM) regardless of computer architecture. Java is a general-purpose, concurrent, class-based, object- oriented language that is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that code that runs on one platform does not need to be recompiled to run on another. Java is as of 2012 one of the most popular programming languages in use, particularly for client-server web applications, with a reported 10 million user.
  • 6. MySql Tables : 1.Package Table: 2.Register Table:
  • 8. Main Page Form Code Admin Button:-
  • 9. private void AdminButtonActionPerformed(java.awt.event.ActionEvent evt) { // Adminform Admin a=new Admin() dispose(); a.show(); } Register Button:- private void RegisterButtonActionPerformed(java.awt.event.ActionEvent evt) { // Registration Form Registration a=new Registration(); dispose(); a.show(); } Book Tickets Button:- private void BookTicketsButtonActionPerformed(java.awt.event.ActionEvent evt) { // TicketsForm tickets a=new tickets();
  • 10. dispose(); a.show(); } Update Booking Button:- private void UpdateBookingButtonActionPerformed(java.awt.event.ActionEvent evt) { // UserSign Form UserSign a=new UserSign(); dispose(); a.show(); } Admin Login form Design
  • 11. Admin Login form Code Imports:-
  • 12. import javax.swing.JOptionPane; SignIn Button:- private void SignInButtonActionPerformed(java.awt.event.ActionEvent evt) { // Id And Password Validation Code String s=jTextField1.getText(); String d=jPasswordField1.getText().toString(); if(s.equals("Hallmark") && d.equals("abc")) { JOptionPane.showMessageDialog(null,"Logged In Successfully"); Adminform a=new Adminform(); dispose(); a.show(); } else { JOptionPane.showMessageDialog(null,"Incorrect Username Or PassWord","Hallmark Tours & Travels",JOptionPane.ERROR_MESSAGE); } Back Button:-
  • 13. private void BackButtonActionPerformed(java.awt.event.ActionEvent evt) { // Back To Main Form Main a=new Main(); dispose(); a.show(); } Admin Form Design
  • 14. Admin Form Code private void formWindowOpened(java.awt.event.WindowEvent evt) {
  • 15. // Code for Label Show 'Hi' Message jLabel1.setText("Hi Admin"); } Add Package Button:- private void AddPackageButtonActionPerformed(java.awt.event.ActionEvent evt) { // AddPackage Form AddPackage a=new AddPackage(); dispose(); a.show(); } Remove Package Button:- private void RemovePackageButtonActionPerformed(java.awt.event.ActionEvent evt) {
  • 16. // Remove Package Form removePackage b=new removePackage(); dispose(); b.show(); } Modify Package Button:- private void ModifyPackageButtonActionPerformed(java.awt.event.ActionEvent evt) { // Modify Package Form ModifyPackage a=new ModifyPackage(); dispose(); a.show(); } View Booking Button:- private void ViewBookingButtonActionPerformed(java.awt.event.ActionEvent evt) { // View User Booking Form
  • 17. viewbooking a=new viewbooking(); dispose(); a.show(); } View User Booking: private void ViewUserButtonActionPerformed(java.awt.event.ActionEvent evt) { // View User Form ViewUser a=new ViewUser(); dispose(); a.show(); } Sign Out Button:- private void SignOutButtonActionPerformed(java.awt.event.ActionEvent evt) { // Main Form Form Main a=new Main(); dispose(); a.show(); }
  • 19. Add Package Form Code Imports:-
  • 20. import java.sql.*; import javax.swing.JOptionPane; import javax.swing.ImageIcon; Connection con; Statement st; ResultSet rs; String query; private void formWindowOpened(java.awt.event.WindowEvent evt) { // Connection Code try{ Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour s","root",""); st=con.createStatement(); rs=st.executeQuery("Select * from package;"); } catch(Exception e){ System.out.print(e.toString()); } }
  • 21. Add Button:- private void AddPackageButtonActionPerformed(java.awt.event.ActionEvent evt) { // Insert Package Code try{ query="Insert into package values('"+jTextField1.getText()+"','"+jTextField2.getText()+"','"+jTextAr ea1.getText()+"',"+adult.getText()+","+child.getText()+");"; st.executeUpdate(query); JOptionPane.showMessageDialog(null,"Package Added Successfully"); } catch(Exception e){ System.out.print(e.toString()); } } Back Button:- private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { // Back To AdminForm
  • 23. Remove Package Form Code Imports:-
  • 24. import java.sql.*; import javax.swing.DefaultListModel; import javax.swing.JOptionPane; Connection con; Statement st; ResultSet rs; String query; private void formWindowOpened(java.awt.event.WindowEvent evt) { // Connection Code & Add Item In List try{ DefaultListModel d=(DefaultListModel)jList1.getModel(); Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour s","root",""); st=con.createStatement(); rs=st.executeQuery("Select * from package;"); while(rs.next()){ d.addElement(rs.getString(1)); } } catch(Exception e){ System.out.print(e.toString());
  • 25. } } Remove Button:- private void RemoveButtonActionPerformed(java.awt.event.ActionEvent evt) { // Delete Package Code try{ query="delete from package where title='"+jList1.getSelectedValue()+"';"; st.executeUpdate(query); JOptionPane.showMessageDialog(null,"Removed Successfully"); } catch(Exception e) { System.out.print(e.toString()); } } Back Button:- private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { // AdminForm Adminform a=new Adminform();
  • 27. Modify Package Form Code Imports:- import java.sql.*; import javax.swing.DefaultListModel; import javax.swing.JOptionPane; Connection con; Statement st; ResultSet rs; String query; private void formWindowOpened(java.awt.event.WindowEvent evt) { // Connection Code && Adding Package In List Code try{ DefaultListModel d=(DefaultListModel)jList1.getModel(); Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour s","root",""); st=con.createStatement(); rs=st.executeQuery("Select * from package;");
  • 28. while(rs.next()){ d.addElement(rs.getString(1)); } } catch(Exception e){ System.out.print(e.toString()); } } private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) { // Retrieve Data from Table String s=(String) jList1.getSelectedValue(); try{ rs=st.executeQuery("Select * from package where Title='"+s+"';"); while(rs.next()){ jTextField1.setText(rs.getString(1)); jTextField2.setText(rs.getString(2)); jTextArea1.setText(rs.getString(3)); child.setText(rs.getString(5)); adult.setText(rs.getString(4)); } }
  • 29. catch(Exception e){ System.out.print(e.toString()); } } Update Button:- private void UpdateButtonActionPerformed(java.awt.event.ActionEvent evt) { // Update Code try{ String s=(String) jList1.getSelectedValue(); query="update package set image='"+jTextField2.getText()+"',info='"+jTextArea1.getText()+"',PAd ult="+adult.getText()+",PChild="+child.getText()+" where title='"+s+"';"; st.executeUpdate(query); JOptionPane.showMessageDialog(null,"Updated Successfully"); } catch(Exception e){ System.out.print(e.toString()); } } Back Button
  • 30. private void BackButtonActionPerformed(java.awt.event.ActionEvent evt) { // AdminForm Adminform a=new Adminform(); dispose(); a.show(); } View Booking Form Design
  • 32. Imports: import javax.swing.table.DefaultTableModel; import java.sql.*; Connection con; Statement st; ResultSet rs; String query; private void formWindowOpened(java.awt.event.WindowEvent evt) { // Connection Code && Adding Rows in Table DefaultTableModel model1=(DefaultTableModel)jTable1.getModel(); try{ Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour s","root",""); st=con.createStatement(); rs=st.executeQuery("Select * from booking;"); while(rs.next()){ model1.addRow(new Object[]{rs.getString(1),rs.getString(4),rs.getString(2),rs.getString(3 ),rs.getString(5)}); } }
  • 33. catch(Exception e){ System.out.print(e.toString()); } } Back Button:- private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // Admin Form Adminform a=new Adminform(); dispose(); a.show(); }
  • 34. View Users Form Design
  • 35. View Users Form Code Import: import java.sql.*; import javax.swing.table.*; Connection con; Statement st; ResultSet rs; String query; private void formWindowOpened(java.awt.event.WindowEvent evt) { // Connection Code && Adding Rows in Table DefaultTableModel model1=(DefaultTableModel)jTable1.getModel(); try{ Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour s","root",""); st=con.createStatement(); rs=st.executeQuery("Select * from register;"); while(rs.next()){ model1.addRow(new Object[]{rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4 ),rs.getString(9),rs.getString(10)});
  • 36. } } catch(Exception e){ System.out.print(e.toString()); } } Back Button:- private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { // Admin Form Adminform a=new Adminform(); dispose(); a.show(); }
  • 38. Register Form Code Imports: import java.sql.*; import javax.swing.JOptionPane; Objects: Connection con; Statement st; ResultSet rs; String query; private void formWindowOpened(java.awt.event.WindowEvent evt) { // ConnectionCode try{ Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour s","root",""); st=con.createStatement(); rs=st.executeQuery("Select * from register;"); } catch(Exception e){ System.out.print(e.toString()); }
  • 39. } Register Button:- private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // Inserting Registered Users Code String s; if(jRadioButton1.isSelected()==true) { s="Male"; } else s="Female"; try{ query="Insert into register values('"+jTextField1.getText()+"','"+jTextField2.getText()+"','"+jTextFie ld3.getText()+"','"+s+"','"+jTextField4.getText()+"','"+jPasswordField1.ge tText().toString()+"','"+jTextField5.getText()+"','"+jTextField6.getText ()+"',"+jTextField7.getText()+",'"+jTextField8.getText()+"');"; st.executeUpdate(query); JOptionPane.showMessageDialog(null,"Registered Successfully"); } catch(Exception e){ System.out.print(e.toString()); }
  • 40. } Back Button private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { // MainForm Main a=new Main(); dispose(); a.show(); } Book Tickets Form Design
  • 41. Book Tickets Form Code Imports: import java.sql.*; import javax.swing.ImageIcon; import javax.swing.DefaultListModel;
  • 42. Connection con; Statement st; ResultSet rs; String query; private void formWindowOpened(java.awt.event.WindowEvent evt) { // Connection Code && Adding Package In LIst try{ DefaultListModel d=(DefaultListModel)jList1.getModel(); Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour s","root",""); st=con.createStatement(); rs=st.executeQuery("Select * from package;"); while(rs.next()){ d.addElement(rs.getString(1)); } } catch(Exception e){ System.out.print(e.toString()); } }
  • 43. private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) { // Setting Image And Desc In TextArea String a=jList1.getSelectedValue().toString(); try{ rs=st.executeQuery("Select * from package where title='"+jList1.getSelectedValue()+"';"); if(rs.next()){ jTextArea1.setText(rs.getString(3)); jLabel1.setIcon(new ImageIcon(""+rs.getString(2))); } } catch(Exception e){ System.out.print(e.toString()); } } Book Tickets Button: private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // Inserting into Temporary Table && Book Form try{ String a=(String) jList1.getSelectedValue(); query="Insert into temp2 values('"+a+"');";
  • 44. st.executeUpdate(query); } catch(Exception e){ System.out.print(e.toString()); } book a=new book(); dispose(); a.show(); } Back Button:- private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { // Main Form Main a=new Main(); dispose(); a.show(); }
  • 47. import javax.swing.ImageIcon; import javax.swing.JOptionPane; Connection con; Statement st; ResultSet rs; ResultSet rs1; String query; Global Variables: // Global Variables int b;int c; double tot; private void formWindowOpened(java.awt.event.WindowEvent evt) { // Connection Code && Setting Image In Label jPanel3.setVisible(false); try{ String s = null; Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour s","root",""); st=con.createStatement(); rs=st.executeQuery("Select * from temp2;"); while(rs.next()){ s=rs.getString(1);
  • 48. } rs1=st.executeQuery("Select * from package where title = '"+s+"'"); while(rs1.next()){ String a=rs1.getString(1); adu.setText(rs1.getString(4)); chi.setText(rs1.getString(5)); img.setIcon(new ImageIcon(""+rs1.getString(2))); jLabel7.setText("Your Package"+" - "+a); } } catch(Exception e){ System.out.print(e.toString()); } } Book Ticket Button:- private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // Userid Validation Code String s=jTextField1.getText(); try{ query="Select * from register where username='"+s+"';"; rs=st.executeQuery(query);
  • 49. if(rs.next()) { jPanel3.setVisible(true); } else { b=JOptionPane.showConfirmDialog(null,"Invalid Id Or"+" Registration Required"+" Click on Yes to Register If not a Member"); { if(b==JOptionPane.YES_OPTION){ Registration w=new Registration(); dispose(); w.show(); } } } } catch(Exception e){ System.out.println(e); } } Book Ticket:-
  • 50. private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { // Calculation & Booking Code String s=null; b=Integer.parseInt(child.getText()); c=Integer.parseInt(adult.getText()); String d=jTextField1.getText(); double ch=0;double ad=0; int x=Integer.parseInt(chi.getText()); int y=Integer.parseInt(adu.getText()); b=Integer.parseInt(child.getText()); c=Integer.parseInt(adult.getText()); if(b<0) { JOptionPane.showMessageDialog(null,"Error Negative Value Invalid"); } if(c<0) { JOptionPane.showMessageDialog(null,"Error Negative Value Invalid"); } ch=x*b; ad=y*c; tot=ch+ad;
  • 51. amt.setText(""+tot); try{ rs=st.executeQuery("Select * from temp2;"); while(rs.next()){ s=rs.getString(1); } query="Insert into booking values('"+s+"',"+b+","+c+",'"+d+"','"+date.getText()+"',"+tot+");"; st.executeUpdate(query); JOptionPane.showMessageDialog(null,"Booked Successfully"); st.executeUpdate("delete from temp2;"); } catch(Exception e){ System.out.print(e.toString()); } } Home Button:- private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { // Main Form Main a=new Main(); dispose(); a.show();
  • 53. Users Login Form Code Imports: import java.sql.*; import javax.swing.JOptionPane; Connection con; Statement st; ResultSet rs; String query; private void formWindowOpened(java.awt.event.WindowEvent evt) { //Connection Code try{ Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour s","root",""); st=con.createStatement(); } catch(Exception e){ System.out.print(e.toString()); } } Sign In Button:
  • 54. private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { //User Validation Code String a; a=jTextField1.getText();int b = 0; try{ rs=st.executeQuery("Select * from register where UserName='"+a+"';"); if(rs.next()){ query="Insert into temp values('"+a+"');"; st.executeUpdate(query); Users w=new Users(); dispose(); w.show(); } else { b=JOptionPane.showConfirmDialog(null,"Invalid Id Or"+" Registration Required"+" Click on Yes to Register If not a Member"); { if(b==JOptionPane.YES_OPTION) { Registration w=new Registration(); dispose();
  • 55. w.show(); } } } } catch(Exception e){ System.out.print(e.toString()); } } Back Button: private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { // Main Form Main a=new Main(); dispose(); a.show(); } Users Form Design
  • 56. Users Form Code View Booking Button: private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
  • 57. // UserViewBook Form UserViewBook l=new UserViewBook(); dispose(); l.show(); } Cancel Booking Button: private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { // CancelBooking Form CancelBooking q=new CancelBooking(); dispose(); q.show(); } Update Booking: private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { //Update Booking Form UpdateBook e=new UpdateBook(); dispose(); e.show();
  • 58. } Sign Out Button: private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) { // Signout Form && Deletion from temperory table try{ st.executeUpdate("delete from temp;"); UserSign z=new UserSign(); dispose(); z.show(); } catch(Exception e){ System.out.print(e.toString()); } }
  • 59. User View Booking Form Design
  • 60. User View Booking Form Code Imports import java.sql.*; import javax.swing.table.DefaultTableModel; Connection con; Statement st; ResultSet rs; ResultSet rs1; String query; private void formWindowOpened(java.awt.event.WindowEvent evt) { // Adding Booking Information In Table & Connection Code DefaultTableModel model1=(DefaultTableModel)jTable1.getModel();
  • 61. Try { String s = null; Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour s","root",""); st=con.createStatement(); rs=st.executeQuery("Select * from temp;"); while(rs.next()){ s=rs.getString(1); jLabel1.setText("Hi"+" "+s+","); } rs1=st.executeQuery("Select * from booking where Username = '"+s+"'"); while(rs1.next()){ model1.addRow(new Object[]{rs1.getString(1),rs1.getString(2),rs1.getString(3),rs1.getString (5),rs1.getString(6)}); } } catch(Exception e){ System.out.print(e.toString()); } } Back Button:
  • 62. private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // User Form Users a=new Users(); dispose(); a.show(); }
  • 64. Cancel Booking Form Code Imports: import java.sql.*; import javax.swing.DefaultListModel; import javax.swing.JOptionPane; Connection con; Statement st; ResultSet rs; ResultSet rs1; String query; private void formWindowOpened(java.awt.event.WindowEvent evt) { // Connection Code && Adding Items In List Code try{ String s = null; DefaultListModel d=(DefaultListModel)jList1.getModel(); Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour s","root",""); st=con.createStatement(); rs1=st.executeQuery("Select * from temp;"); while(rs1.next()){
  • 65. s=rs1.getString(1); jLabel1.setText("Hi"+" "+s+","); } rs=st.executeQuery("Select Pname from booking where Username='"+s+"';"); while(rs.next()){ d.addElement(rs.getString(1)); } } catch(Exception e){ System.out.print(e.toString()); } } Cancel Button: private void CancelButtonActionPerformed(java.awt.event.ActionEvent evt) { // Delete Booking Code try{ query="delete from booking where Pname='"+jList1.getSelectedValue()+"';"; st.executeUpdate(query); JOptionPane.showMessageDialog(null,"Removed Successfully"); } catch(Exception e) {
  • 66. System.out.print(e.toString()); } } Back Button: private void BackButtonActionPerformed(java.awt.event.ActionEvent evt) { //Users Form Users a=new Users(); dispose(); a.show(); } User Update Booking Form Design
  • 67. User Update Booking Form Code Imports: import java.sql.*; import javax.swing.DefaultListModel; import javax.swing.JOptionPane;
  • 68. Connection con; Statement st; ResultSet rs; ResultSet rs1; ResultSet rs2; String query; private void formWindowOpened(java.awt.event.WindowEvent evt) { //Connection Code && List Code try{ String s = null; DefaultListModel d=(DefaultListModel)jList1.getModel(); Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/tour s","root",""); st=con.createStatement(); rs1=st.executeQuery("Select * from temp;"); while(rs1.next()){ s=rs1.getString(1); jLabel8.setText("Hi"+" "+s+","); }
  • 69. rs=st.executeQuery("Select Pname from booking where Username='"+s+"';"); while(rs.next()){ d.addElement(rs.getString(1)); } } catch(Exception e){ System.out.print(e.toString()); } } private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) { //Package Selection Code String s=(String) jList1.getSelectedValue(); String j=null; try{ rs2=st.executeQuery("Select * from temp;"); while(rs2.next()){ j=rs2.getString(1); } rs=st.executeQuery("Select * from booking where Pname='"+s+"'&& Username='"+j+"';"); while(rs.next()){
  • 70. adult.setText(rs.getString(3)); child.setText(rs.getString(2)); date.setText(rs.getString(5)); tot.setText(rs.getString(6)); } rs1=st.executeQuery("Select * from package where Title='"+s+"';"); while(rs1.next()){ adu.setText(rs1.getString(4)); chi.setText(rs1.getString(5)); } } catch(Exception e){ System.out.print(e.toString()); } } Calculate Button private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { //Calculation Code int a=Integer.parseInt(child.getText()); int b=Integer.parseInt(adult.getText()); int c=Integer.parseInt(adu.getText());
  • 71. int d=Integer.parseInt(chi.getText()); if(a<0 && b<0) { JOptionPane.showMessageDialog(null,"Please Enter Valid Number"); } if(a<0 || b<0) { JOptionPane.showMessageDialog(null,"Please Enter Valid Number"); } double s=a*d; double j=b*c; double x=s+j; tot.setText(""+x); } Update Button: private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { // Update Code try{ String s=null; rs1=st.executeQuery("Select * from temp;"); while(rs1.next()){
  • 72. s=rs1.getString(1); } query="update booking set child='"+child.getText()+"',adult='"+adult.getText()+"',date='"+date.get Text()+"',total="+tot.getText()+" where Username='"+s+"';"; st.executeUpdate(query); JOptionPane.showMessageDialog(null,"Updated Successfully"); } catch(Exception e){ System.out.print(e.toString()); } } Back Button: private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { //Users Form Users a=new Users(); dispose(); a.show(); }
  • 73. Bibliography  WWW.Google.com  Informatics Practices for Class 11 - Sumita Arora. Informatics Practices for Class 12 - Sumita Arora