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

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
 
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
 
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
 
The Lost Spring English Class 12
The Lost Spring English Class 12The Lost Spring English Class 12
The Lost Spring English Class 12KarthikKrishnadas
 
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 with python project for class 12 cbse
computer science with python project for class 12 cbsecomputer science with python project for class 12 cbse
computer science with python project for class 12 cbsemanishjain598
 
Computer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school managementComputer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school managementRemaDeosiSundi
 
Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdfHarshitSachdeva17
 
CANTEEN MANAGEMENT SYSTEM IN PYTHON
CANTEEN MANAGEMENT SYSTEM IN PYTHONCANTEEN MANAGEMENT SYSTEM IN PYTHON
CANTEEN MANAGEMENT SYSTEM IN PYTHONvikram mahendra
 
C.S. project report on railway ticket reservation
C.S. project report on railway ticket reservationC.S. project report on railway ticket reservation
C.S. project report on railway ticket reservationVirat Prasad
 
English project
English projectEnglish project
English projectjasvin2
 
cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IPD. j Vicky
 
Report Card making BY Mitul Patel
Report Card making BY Mitul PatelReport Card making BY Mitul Patel
Report Card making BY Mitul PatelMitul Patel
 
IP Final project 12th
IP Final project 12thIP Final project 12th
IP Final project 12thSantySS
 
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
 
BOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in PythonBOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in Pythonvikram mahendra
 
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
 
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfCOMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfAkshatTiwari530170
 
Class 12(ENGLISH) ASL project file
Class 12(ENGLISH) ASL project fileClass 12(ENGLISH) ASL project file
Class 12(ENGLISH) ASL project fileAryan252321
 

What's hot (20)

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
 
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
 
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
 
The Lost Spring English Class 12
The Lost Spring English Class 12The Lost Spring English Class 12
The Lost Spring English Class 12
 
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 with python project for class 12 cbse
computer science with python project for class 12 cbsecomputer science with python project for class 12 cbse
computer science with python project for class 12 cbse
 
Computer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school managementComputer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school management
 
Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdf
 
CANTEEN MANAGEMENT SYSTEM IN PYTHON
CANTEEN MANAGEMENT SYSTEM IN PYTHONCANTEEN MANAGEMENT SYSTEM IN PYTHON
CANTEEN MANAGEMENT SYSTEM IN PYTHON
 
C.S. project report on railway ticket reservation
C.S. project report on railway ticket reservationC.S. project report on railway ticket reservation
C.S. project report on railway ticket reservation
 
English project
English projectEnglish project
English project
 
cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IP
 
Report Card making BY Mitul Patel
Report Card making BY Mitul PatelReport Card making BY Mitul Patel
Report Card making BY Mitul Patel
 
IP Final project 12th
IP Final project 12thIP Final project 12th
IP Final project 12th
 
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
 
BOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in PythonBOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in Python
 
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
 
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfCOMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
 
Acknowledgement
AcknowledgementAcknowledgement
Acknowledgement
 
Class 12(ENGLISH) ASL project file
Class 12(ENGLISH) ASL project fileClass 12(ENGLISH) ASL project file
Class 12(ENGLISH) ASL project file
 

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

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 

Recently uploaded (20)

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.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