SlideShare a Scribd company logo
PROJECT REPORT
RAILWAY
RESERVATION
SYSTEM
2015-16
Faculty concern By.
Dr. Harikesh Singh Prashant Sharma
CSE Dept. 131042
ECE A2
TABLE OF CONTENTS
S.No Topic Page No.
1. Main Frame 3
2. Check Train
Schedule Frame
5
3. Check Seat
Availability
Frame
8
4. Book Ticket
Frame
11
5. Check Ticket
Frame
15
6. Cancel Ticket
Frame
17
7. How to create a
SQL file
19
8. How to use a SQL
file
20
MAIN FRAME
CODE:
//code for radio button check train schedule
Trainbtwstations a=new Trainbtwstations();
a.setVisible(true);
//code for radio button book ticket
Book d=new Book();
d.setVisible(true);
//code for radio button check availiability
Checkavailability e=new Checkavailability();
e.setVisible(true);
//code for radio button check your ticket
CheckTicket a=new CheckTicket();
a.setVisible(true);
//code for radio button cancel your ticket
Cancel b=new Cancel();
b.setVisible(true);
//code for exit button
System.exit(0);
CHECK TRAIN SCHEDULE FRAME
CODE:
IMPORT FILES:
import java.sql.*;
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.ResultSet;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
CODE FOR CHECK TRAIN BUTTON
String start=(String)classs1.getSelectedItem();
String fin=(String)classs2.getSelectedItem();
if (start.isEmpty())
{
JOptionPane.showMessageDialog(this,"Enter the Starting destination");
}
if (fin.isEmpty())
{
JOptionPane.showMessageDialog(this,"Enter the final destination");
}
else
{
DefaultTableModel model=(DefaultTableModel) tab1.getModel();
Connection con=null;
try {
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/railway","root","root");
if(con!=null){
Statement stmt =con.createStatement();
//String query="SELECT * from trainbtw where (source = '"+start+"' and des =
'"+fin+"');";
ResultSet rs=stmt.executeQuery("SELECT * from trainbtw where (source = '"+start+"' and
des = '"+fin+"');");
while (rs.next())
{
int tn = rs.getInt("tno");
String tname = rs.getString("tname");
String strt = rs.getString("source");
String fnl = rs.getString("des");
model.addRow(new Object[]{tn,tname,strt,fnl});
}
}
}
catch (Exception e)
{
JOptionPane.showMessageDialog(null, "error in connectivity");
}
}
}
CODE FOR HOME BUTTON
OnlineReservation b=new OnlineReservation();
b.setVisible(false);
CODE FOR NEXT BUTTON
Checkavailability b=new Checkavailability();
b.setVisible(true);
CHECK SEAT AVAILABILITY FRAME
CODE:
IMPORT FILES:
import java.sql.*;
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.ResultSet;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel
CODE FOR CHECK AVAILABILITY BUTTON
String tno=t1.getText();
DefaultTableModel model=(DefaultTableModel)tab1.getModel();
Connection con=null;
try{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/railway","root","root");
Statement stmt=con.createStatement();
//String query="select * from avail where TableNo='"+tno+"' ;";
ResultSet rs=stmt.executeQuery("select * from avail where TrainNo='"+tno+"' ;");
while(rs.next()){
String tn=rs.getString("TrainNo");
String tname=rs.getString("TrainName");
String fac=rs.getString("FirstAC");
String sac=rs.getString("SecondAC");
String tac=rs.getString("ThirdAC");
String sle=rs.getString("Sleeper");
model.addRow(new Object[]{tn,tname,fac,sac,tac,sle});
}
}
catch(Exception e){
JOptionPane.showMessageDialog(rootPane, "error");
}
CODE FOR GET TICKET BUTTON
Book h=new Book();
h.setVisible(true);
CODE FOR BACK BUTTON
Trainbtwstations b=new Trainbtwstations();
b.setVisible(true);
CODE FOR HOME BUTTON
OnlineReservation b=new OnlineReservation();
b.setVisible(true);
CODE FOR COMBO BOX
if(c1.getSelectedIndex()==0)
t1.setText("" +3245);
else
if(c1.getSelectedIndex()==1)
t1.setText("" +2345);
else
if(c1.getSelectedIndex()==2)
t1.setText("" +2931);
else
if(c1.getSelectedIndex()==3)
t1.setText("" +8412);
else
if(c1.getSelectedIndex()==4)
t1.setText("" +3429);
else
if(c1.getSelectedIndex()==5)
t1.setText("" +7103);
BOOK TICKET FRAME
CODE:
IMPORT FILES:
import java.sql.*;
import java.sql.DriverManager;
import java.sql.Statement;
import javax.swing.JOptionPane;
CODE FOR SUBMIT BUTTON
String tno=t2.getText();
String tname=(String)c2.getSelectedItem();
String source=(String)classs1.getSelectedItem();
String des=(String)classs2.getSelectedItem();
String name=t5.getText();
String cla=(String)classs.getSelectedItem();
String age=t7.getText();
String contact=t6.getText();
String sex="";
if(Male.isSelected()){
sex="Male";
}
else
if(Female.isSelected()){
sex="Female";
}
else if(other.isSelected()){
sex="Other";
}
String date=t1.getText();
Connection con=null;
try{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/railway","root","root");
if(con!=null){
Statement stmt=con.createStatement();
int pnr=100000;
ResultSet rs=stmt.executeQuery("select pnr from book order by pnr desc limit 1");
while(rs.next()){
pnr=rs.getInt("pnr");
}
pnr++;
String query="insert into book
values("+pnr+","+tno+",'"+tname+"','"+source+"','"+des+"','"+cla+"','"+name+"',"+contact+",
"+age+",'"+sex+"','"+date+"')";
int r=stmt.executeUpdate(query);
if(r!=0){
ResultSet rs1=stmt.executeQuery("select "+cla+" from avail where TrainNo="+tno);
int no_seat=0;
while(rs1.next()){
no_seat=rs1.getInt(1);
}
no_seat--;
int r1=stmt.executeUpdate("update avail set "+cla+"="+no_seat+" where
TrainNo="+tno);
JOptionPane.showMessageDialog(rootPane, "Your pnr : "+pnr);
if(r1!=0){
this.dispose();
new OnlineReservation().setVisible(true);
}
}
else{
JOptionPane.showMessageDialog(rootPane, "booking not Possible / worng credentials:
");
}
}
else{
JOptionPane.showMessageDialog(rootPane, "connection error ");
}
}
catch(Exception e)
{
System.out.println(e);
//JOptionPane.showMessageDialog(rootPane, "ERROR");
} }
CODE FOR COMBO BOX
if(c2.getSelectedIndex()==0)
t2.setText("" +0000);
else
if(c2.getSelectedIndex()==1)
t2.setText("" +3245);
else
if(c2.getSelectedIndex()==2)
t2.setText("" +2345);
else
if(c2.getSelectedIndex()==3)
t2.setText("" +2931);
else
if(c2.getSelectedIndex()==4)
t2.setText("" +8412);
else
if(c2.getSelectedIndex()==5)
t2.setText("" +3429);
else
if(c2.getSelectedIndex()==6)
t2.setText("" +7103);
CODE FOR BACK BUTTON
Checkavailability b=new Checkavailability();
b.setVisible(true);
CODE FOR HOME BUTTON
OnlineReservation b=new OnlineReservation();
b.setVisible(true);
CHECK TICKET FRAME
CODE:
IMPORT FILES:
import java.sql.*;
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.ResultSet;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
CODE FOR CHECK BUTTON
String n=t1.getText();
String a=t2.getText();
DefaultTableModel model=(DefaultTableModel) tab1.getModel();
Connection con=null;
try{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/railway","root","root");
if(con!=null){
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("SELECT pnr,tno,tname,class,name,age from book where
(pnr = "+n+" and name = '"+a+"');");
if(rs.next())
{ String po=rs.getString("pnr");
String to=rs.getString("tno");
String tn=rs.getString("tname");
String cl=rs.getString("class");
String na=rs.getString("name");
String ag=rs.getString("age");
model.addRow(new Object[]{to,po,na,ag,tn,cl});
} else
{
JOptionPane.showMessageDialog(rootPane,"PNR or Name is wrong");
}
}
}
catch(Exception e){
JOptionPane.showMessageDialog(rootPane, "error");
}
CODE FOR HOME BUTTON
OnlineReservation b=new OnlineReservation();
b.setVisible(true);
CODE FOR CONFIRM BUTTON
d1.setVisible(true);
CANCEL TICKET FRAME
CODE:
IMPORT FILES:
import java.sql.*;
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
CODE FOR CANCEL YOUR TICKET BUTTON
String a=t1.getText();
String name=t2.getText();
String cla=(String)classs2.getSelectedItem();
String tno=t3.getText();
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection
("jdbc:mysql://localhost:3306/railway","root","root");
Statement stmt=con.createStatement();
//String query="delete from book where pnr='"+a+"' and name='"+name+"';";
int r=stmt.executeUpdate("delete from book where pnr='"+a+"';");
if(r!=0){
ResultSet rs1=stmt.executeQuery("select "+cla+" from avail where TrainNo="+tno);
int no_seat=0;
while(rs1.next()){
no_seat=rs1.getInt(1);
}
no_seat++;
int r1=stmt.executeUpdate("update avail set "+cla+"="+no_seat+" where
TrainNo="+tno);
d3.setVisible(true);
}
else
{
d2.setVisible(true);
}
}
catch(ClassNotFoundException e)
{
JOptionPane.showMessageDialog(rootPane, "ERROR");
} catch (SQLException e) {
JOptionPane.showMessageDialog(rootPane, "ERROR");
}
CODE FOR HOME BUTTON
OnlineReservation b=new OnlineReservation();
b.setVisible(true);
HOW TO CREATA A SQL FILE OF A
DATABASE FROM COMMAND PROMPT
This is the procedure to create a sql file from a database in mysql:
1. Open command prompt in admin mode.
2.Now change directory to the bin directory of the mysql.
3.Now type the below command in the command prompt and then enter the password of your
mysql.
4.Press enter and now you can find your database sql file in the bin folder of mysql.
HOW TO USE A SQL FILE FROM COMMAND
PROMPT IN ANOTHER PC
Procedure:
1.Open mysql and create database (give any name);
2.Now type command use “databasename”;
3.Now paste the .sql file in your bin folder of mysql.
4.Now open command prompt and change the directory to the bin directory of mysql.
5. now type the command as shown below

More Related Content

What's hot

railway reservation software documentaion
railway reservation software documentaionrailway reservation software documentaion
railway reservation software documentaion
Joveria Beg
 
Train ticket reservation
Train ticket reservationTrain ticket reservation
Train ticket reservation
sazzadur rahman
 
SRS for Railways Reservation System
SRS for Railways Reservation System SRS for Railways Reservation System
SRS for Railways Reservation System
Vignesh Arun
 
Railway Reservation system
Railway Reservation systemRailway Reservation system
Railway Reservation system
Nikhil Yennampally
 
Railway management system, database mini project
Railway management system, database mini projectRailway management system, database mini project
Railway management system, database mini project
shashank reddy
 
Online railway reservation system
Online railway reservation systemOnline railway reservation system
Online railway reservation system
राजेंद्र कदम
 
Synopsis for Online Railway Railway Reservation System
Synopsis for Online Railway Railway Reservation SystemSynopsis for Online Railway Railway Reservation System
Synopsis for Online Railway Railway Reservation System
ZainabNoorGul
 
19701759 project-report-on-railway-reservation-system-by-amit-mittal
19701759 project-report-on-railway-reservation-system-by-amit-mittal19701759 project-report-on-railway-reservation-system-by-amit-mittal
19701759 project-report-on-railway-reservation-system-by-amit-mittalsatyaragha786
 
Online Bus Reservation
Online Bus ReservationOnline Bus Reservation
Online Bus Reservation
Astha Patel
 
Presentation on Railway Reservation System
Presentation on Railway Reservation SystemPresentation on Railway Reservation System
Presentation on Railway Reservation SystemPriyanka Sharma
 
Documentation of railway reservation system
Documentation of railway reservation systemDocumentation of railway reservation system
Documentation of railway reservation systemSandip Murari
 
srs for railway reservation system
 srs for railway reservation system srs for railway reservation system
srs for railway reservation system
khushi kalaria
 
RAILWAY RESERVATION SYSTEM.pptx
RAILWAY RESERVATION SYSTEM.pptxRAILWAY RESERVATION SYSTEM.pptx
RAILWAY RESERVATION SYSTEM.pptx
ManishBhoir6
 
E-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATIONE-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATION
Nandana Priyanka Eluri
 
Railway Reservation Documentation
Railway Reservation DocumentationRailway Reservation Documentation
Railway Reservation Documentation
Kunwar Singh
 
Railway Reservation system
Railway Reservation systemRailway Reservation system
Railway Reservation system
Masum Rehman
 
e-commerce web development project report (Bookz report)
e-commerce web development project report (Bookz report)e-commerce web development project report (Bookz report)
e-commerce web development project report (Bookz report)
Mudasir Ahmad Bhat
 
Synopsis on railway reservation system
Synopsis on railway reservation systemSynopsis on railway reservation system
Synopsis on railway reservation system
Ankit Verma
 
TRAIN TICKETING SYSTEM
TRAIN TICKETING SYSTEMTRAIN TICKETING SYSTEM
TRAIN TICKETING SYSTEMNimRaH NaZaR
 
Bus Ticket Management System Documentation
Bus Ticket Management System DocumentationBus Ticket Management System Documentation
Bus Ticket Management System Documentationmuzammil siddiq
 

What's hot (20)

railway reservation software documentaion
railway reservation software documentaionrailway reservation software documentaion
railway reservation software documentaion
 
Train ticket reservation
Train ticket reservationTrain ticket reservation
Train ticket reservation
 
SRS for Railways Reservation System
SRS for Railways Reservation System SRS for Railways Reservation System
SRS for Railways Reservation System
 
Railway Reservation system
Railway Reservation systemRailway Reservation system
Railway Reservation system
 
Railway management system, database mini project
Railway management system, database mini projectRailway management system, database mini project
Railway management system, database mini project
 
Online railway reservation system
Online railway reservation systemOnline railway reservation system
Online railway reservation system
 
Synopsis for Online Railway Railway Reservation System
Synopsis for Online Railway Railway Reservation SystemSynopsis for Online Railway Railway Reservation System
Synopsis for Online Railway Railway Reservation System
 
19701759 project-report-on-railway-reservation-system-by-amit-mittal
19701759 project-report-on-railway-reservation-system-by-amit-mittal19701759 project-report-on-railway-reservation-system-by-amit-mittal
19701759 project-report-on-railway-reservation-system-by-amit-mittal
 
Online Bus Reservation
Online Bus ReservationOnline Bus Reservation
Online Bus Reservation
 
Presentation on Railway Reservation System
Presentation on Railway Reservation SystemPresentation on Railway Reservation System
Presentation on Railway Reservation System
 
Documentation of railway reservation system
Documentation of railway reservation systemDocumentation of railway reservation system
Documentation of railway reservation system
 
srs for railway reservation system
 srs for railway reservation system srs for railway reservation system
srs for railway reservation system
 
RAILWAY RESERVATION SYSTEM.pptx
RAILWAY RESERVATION SYSTEM.pptxRAILWAY RESERVATION SYSTEM.pptx
RAILWAY RESERVATION SYSTEM.pptx
 
E-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATIONE-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATION
 
Railway Reservation Documentation
Railway Reservation DocumentationRailway Reservation Documentation
Railway Reservation Documentation
 
Railway Reservation system
Railway Reservation systemRailway Reservation system
Railway Reservation system
 
e-commerce web development project report (Bookz report)
e-commerce web development project report (Bookz report)e-commerce web development project report (Bookz report)
e-commerce web development project report (Bookz report)
 
Synopsis on railway reservation system
Synopsis on railway reservation systemSynopsis on railway reservation system
Synopsis on railway reservation system
 
TRAIN TICKETING SYSTEM
TRAIN TICKETING SYSTEMTRAIN TICKETING SYSTEM
TRAIN TICKETING SYSTEM
 
Bus Ticket Management System Documentation
Bus Ticket Management System DocumentationBus Ticket Management System Documentation
Bus Ticket Management System Documentation
 

Viewers also liked

ECE 24 Final Report 052209
ECE 24 Final Report 052209ECE 24 Final Report 052209
ECE 24 Final Report 052209crh342
 
[Airline Information System] in Database Project presntation
[Airline Information System] in Database Project presntation[Airline Information System] in Database Project presntation
[Airline Information System] in Database Project presntation
Syed Muhammad Zeejah Hashmi
 
Saur lecture 16
Saur lecture 16Saur lecture 16
Saur lecture 16
saur28_83
 
finel report on india map project
finel report on india map projectfinel report on india map project
finel report on india map projectAshish Sharma
 
Railway reservation management by sandip murari
Railway reservation management by sandip murariRailway reservation management by sandip murari
Railway reservation management by sandip murariSandip Murari
 
Airline Reservation System - Model Driven Software Engineering Approach
Airline Reservation System - Model Driven Software Engineering ApproachAirline Reservation System - Model Driven Software Engineering Approach
Airline Reservation System - Model Driven Software Engineering ApproachOnkar Kadam
 
Online Airline Ticket reservation System
Online Airline Ticket reservation SystemOnline Airline Ticket reservation System
Online Airline Ticket reservation Systemsathyakawthar
 
Airline Reservation System - Software Engineering
Airline Reservation System - Software EngineeringAirline Reservation System - Software Engineering
Airline Reservation System - Software Engineering
Drishti Bhalla
 
Railway Ticket Issuing System (Online)
Railway Ticket Issuing System (Online)Railway Ticket Issuing System (Online)
Railway Ticket Issuing System (Online)
Rashmika Nawaratne
 
Sequential Circuits - Flip Flops (Part 2)
Sequential Circuits - Flip Flops (Part 2)Sequential Circuits - Flip Flops (Part 2)
Sequential Circuits - Flip Flops (Part 2)
Abhilash Nair
 
The railway ticket service c++ project class 12
The railway ticket service c++ project class 12The railway ticket service c++ project class 12
The railway ticket service c++ project class 12
Sandeep Chandel
 
Introduction to airline reservation systems
Introduction to airline reservation systemsIntroduction to airline reservation systems
Introduction to airline reservation systemsJava and .NET Architect
 
Efectos nocivos de la tecnología informática en el medio ambiente
Efectos nocivos de la tecnología informática en el medio ambienteEfectos nocivos de la tecnología informática en el medio ambiente
Efectos nocivos de la tecnología informática en el medio ambiente
Fernando Londoño
 

Viewers also liked (14)

ECE 24 Final Report 052209
ECE 24 Final Report 052209ECE 24 Final Report 052209
ECE 24 Final Report 052209
 
Artigo Revista Protecao Julho2015
Artigo Revista Protecao Julho2015Artigo Revista Protecao Julho2015
Artigo Revista Protecao Julho2015
 
[Airline Information System] in Database Project presntation
[Airline Information System] in Database Project presntation[Airline Information System] in Database Project presntation
[Airline Information System] in Database Project presntation
 
Saur lecture 16
Saur lecture 16Saur lecture 16
Saur lecture 16
 
finel report on india map project
finel report on india map projectfinel report on india map project
finel report on india map project
 
Railway reservation management by sandip murari
Railway reservation management by sandip murariRailway reservation management by sandip murari
Railway reservation management by sandip murari
 
Airline Reservation System - Model Driven Software Engineering Approach
Airline Reservation System - Model Driven Software Engineering ApproachAirline Reservation System - Model Driven Software Engineering Approach
Airline Reservation System - Model Driven Software Engineering Approach
 
Online Airline Ticket reservation System
Online Airline Ticket reservation SystemOnline Airline Ticket reservation System
Online Airline Ticket reservation System
 
Airline Reservation System - Software Engineering
Airline Reservation System - Software EngineeringAirline Reservation System - Software Engineering
Airline Reservation System - Software Engineering
 
Railway Ticket Issuing System (Online)
Railway Ticket Issuing System (Online)Railway Ticket Issuing System (Online)
Railway Ticket Issuing System (Online)
 
Sequential Circuits - Flip Flops (Part 2)
Sequential Circuits - Flip Flops (Part 2)Sequential Circuits - Flip Flops (Part 2)
Sequential Circuits - Flip Flops (Part 2)
 
The railway ticket service c++ project class 12
The railway ticket service c++ project class 12The railway ticket service c++ project class 12
The railway ticket service c++ project class 12
 
Introduction to airline reservation systems
Introduction to airline reservation systemsIntroduction to airline reservation systems
Introduction to airline reservation systems
 
Efectos nocivos de la tecnología informática en el medio ambiente
Efectos nocivos de la tecnología informática en el medio ambienteEfectos nocivos de la tecnología informática en el medio ambiente
Efectos nocivos de la tecnología informática en el medio ambiente
 

Similar to Railway reservation system

Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4Abed Bukhari
 
5 Rmi Print
5  Rmi Print5  Rmi Print
5 Rmi Print
varadasuren
 
bai giai de LTWINForm.docx
bai giai de LTWINForm.docxbai giai de LTWINForm.docx
bai giai de LTWINForm.docx
VnThanh292761
 
import java-util--- import java-io--- class Vertex { -- Constructo.docx
import java-util--- import java-io---   class Vertex {   -- Constructo.docximport java-util--- import java-io---   class Vertex {   -- Constructo.docx
import java-util--- import java-io--- class Vertex { -- Constructo.docx
Blake0FxCampbelld
 
Create a Flight class that uses the Plane and Time class. This class.pdf
Create a Flight class that uses the Plane and Time class. This class.pdfCreate a Flight class that uses the Plane and Time class. This class.pdf
Create a Flight class that uses the Plane and Time class. This class.pdf
daniamantileonismc36
 
Create a JAVA program that performs file IO and database interaction.pdf
Create a JAVA program that performs file IO and database interaction.pdfCreate a JAVA program that performs file IO and database interaction.pdf
Create a JAVA program that performs file IO and database interaction.pdf
malavshah9013
 
Implement a queue using a linkedlist (java)SolutionLinkedQueue.pdf
Implement a queue using a linkedlist (java)SolutionLinkedQueue.pdfImplement a queue using a linkedlist (java)SolutionLinkedQueue.pdf
Implement a queue using a linkedlist (java)SolutionLinkedQueue.pdf
kostikjaylonshaewe47
 
2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good Tests2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good Tests
Tomek Kaczanowski
 
Executing Sql Commands
Executing Sql CommandsExecuting Sql Commands
Executing Sql Commandsleminhvuong
 
Executing Sql Commands
Executing Sql CommandsExecuting Sql Commands
Executing Sql Commandsphanleson
 
Advance Java Programs skeleton
Advance Java Programs skeletonAdvance Java Programs skeleton
Advance Java Programs skeleton
Iram Ramrajkar
 
3 database-jdbc(1)
3 database-jdbc(1)3 database-jdbc(1)
3 database-jdbc(1)
hameedkhan2017
 
2019-10-05 - Untangled - Voxxed days ticino
2019-10-05 - Untangled - Voxxed days ticino2019-10-05 - Untangled - Voxxed days ticino
2019-10-05 - Untangled - Voxxed days ticino
Arnaud Bos
 
help me Java projectI put problem and my own code in the linkmy .pdf
help me Java projectI put problem and my own code in the linkmy .pdfhelp me Java projectI put problem and my own code in the linkmy .pdf
help me Java projectI put problem and my own code in the linkmy .pdf
arihantmum
 
Embedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for JavaEmbedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for JavaJevgeni Kabanov
 
Using NetBeansImplement a queue named QueueLL using a Linked List .pdf
Using NetBeansImplement a queue named QueueLL using a Linked List .pdfUsing NetBeansImplement a queue named QueueLL using a Linked List .pdf
Using NetBeansImplement a queue named QueueLL using a Linked List .pdf
siennatimbok52331
 

Similar to Railway reservation system (20)

Ss
SsSs
Ss
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4
 
5 Rmi Print
5  Rmi Print5  Rmi Print
5 Rmi Print
 
bai giai de LTWINForm.docx
bai giai de LTWINForm.docxbai giai de LTWINForm.docx
bai giai de LTWINForm.docx
 
import java-util--- import java-io--- class Vertex { -- Constructo.docx
import java-util--- import java-io---   class Vertex {   -- Constructo.docximport java-util--- import java-io---   class Vertex {   -- Constructo.docx
import java-util--- import java-io--- class Vertex { -- Constructo.docx
 
Create a Flight class that uses the Plane and Time class. This class.pdf
Create a Flight class that uses the Plane and Time class. This class.pdfCreate a Flight class that uses the Plane and Time class. This class.pdf
Create a Flight class that uses the Plane and Time class. This class.pdf
 
Create a JAVA program that performs file IO and database interaction.pdf
Create a JAVA program that performs file IO and database interaction.pdfCreate a JAVA program that performs file IO and database interaction.pdf
Create a JAVA program that performs file IO and database interaction.pdf
 
Implement a queue using a linkedlist (java)SolutionLinkedQueue.pdf
Implement a queue using a linkedlist (java)SolutionLinkedQueue.pdfImplement a queue using a linkedlist (java)SolutionLinkedQueue.pdf
Implement a queue using a linkedlist (java)SolutionLinkedQueue.pdf
 
2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good Tests2012 JDays Bad Tests Good Tests
2012 JDays Bad Tests Good Tests
 
Executing Sql Commands
Executing Sql CommandsExecuting Sql Commands
Executing Sql Commands
 
Executing Sql Commands
Executing Sql CommandsExecuting Sql Commands
Executing Sql Commands
 
Advance Java Programs skeleton
Advance Java Programs skeletonAdvance Java Programs skeleton
Advance Java Programs skeleton
 
My java file
My java fileMy java file
My java file
 
3 database-jdbc(1)
3 database-jdbc(1)3 database-jdbc(1)
3 database-jdbc(1)
 
2019-10-05 - Untangled - Voxxed days ticino
2019-10-05 - Untangled - Voxxed days ticino2019-10-05 - Untangled - Voxxed days ticino
2019-10-05 - Untangled - Voxxed days ticino
 
help me Java projectI put problem and my own code in the linkmy .pdf
help me Java projectI put problem and my own code in the linkmy .pdfhelp me Java projectI put problem and my own code in the linkmy .pdf
help me Java projectI put problem and my own code in the linkmy .pdf
 
C# labprograms
C# labprogramsC# labprograms
C# labprograms
 
Embedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for JavaEmbedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for Java
 
Data struture lab
Data struture labData struture lab
Data struture lab
 
Using NetBeansImplement a queue named QueueLL using a Linked List .pdf
Using NetBeansImplement a queue named QueueLL using a Linked List .pdfUsing NetBeansImplement a queue named QueueLL using a Linked List .pdf
Using NetBeansImplement a queue named QueueLL using a Linked List .pdf
 

Recently uploaded

Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 

Recently uploaded (20)

Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 

Railway reservation system

  • 1. PROJECT REPORT RAILWAY RESERVATION SYSTEM 2015-16 Faculty concern By. Dr. Harikesh Singh Prashant Sharma CSE Dept. 131042 ECE A2
  • 2. TABLE OF CONTENTS S.No Topic Page No. 1. Main Frame 3 2. Check Train Schedule Frame 5 3. Check Seat Availability Frame 8 4. Book Ticket Frame 11 5. Check Ticket Frame 15 6. Cancel Ticket Frame 17 7. How to create a SQL file 19 8. How to use a SQL file 20
  • 3. MAIN FRAME CODE: //code for radio button check train schedule Trainbtwstations a=new Trainbtwstations(); a.setVisible(true); //code for radio button book ticket Book d=new Book(); d.setVisible(true); //code for radio button check availiability Checkavailability e=new Checkavailability(); e.setVisible(true); //code for radio button check your ticket CheckTicket a=new CheckTicket(); a.setVisible(true);
  • 4. //code for radio button cancel your ticket Cancel b=new Cancel(); b.setVisible(true); //code for exit button System.exit(0);
  • 5. CHECK TRAIN SCHEDULE FRAME CODE: IMPORT FILES: import java.sql.*; import java.sql.DriverManager; import java.sql.Statement; import java.sql.ResultSet; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; CODE FOR CHECK TRAIN BUTTON String start=(String)classs1.getSelectedItem(); String fin=(String)classs2.getSelectedItem(); if (start.isEmpty()) {
  • 6. JOptionPane.showMessageDialog(this,"Enter the Starting destination"); } if (fin.isEmpty()) { JOptionPane.showMessageDialog(this,"Enter the final destination"); } else { DefaultTableModel model=(DefaultTableModel) tab1.getModel(); Connection con=null; try { Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/railway","root","root"); if(con!=null){ Statement stmt =con.createStatement(); //String query="SELECT * from trainbtw where (source = '"+start+"' and des = '"+fin+"');"; ResultSet rs=stmt.executeQuery("SELECT * from trainbtw where (source = '"+start+"' and des = '"+fin+"');"); while (rs.next()) { int tn = rs.getInt("tno"); String tname = rs.getString("tname"); String strt = rs.getString("source"); String fnl = rs.getString("des"); model.addRow(new Object[]{tn,tname,strt,fnl}); } } }
  • 7. catch (Exception e) { JOptionPane.showMessageDialog(null, "error in connectivity"); } } } CODE FOR HOME BUTTON OnlineReservation b=new OnlineReservation(); b.setVisible(false); CODE FOR NEXT BUTTON Checkavailability b=new Checkavailability(); b.setVisible(true);
  • 8. CHECK SEAT AVAILABILITY FRAME CODE: IMPORT FILES: import java.sql.*; import java.sql.DriverManager; import java.sql.Statement; import java.sql.ResultSet; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel CODE FOR CHECK AVAILABILITY BUTTON String tno=t1.getText(); DefaultTableModel model=(DefaultTableModel)tab1.getModel(); Connection con=null; try{ Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/railway","root","root"); Statement stmt=con.createStatement(); //String query="select * from avail where TableNo='"+tno+"' ;"; ResultSet rs=stmt.executeQuery("select * from avail where TrainNo='"+tno+"' ;"); while(rs.next()){
  • 9. String tn=rs.getString("TrainNo"); String tname=rs.getString("TrainName"); String fac=rs.getString("FirstAC"); String sac=rs.getString("SecondAC"); String tac=rs.getString("ThirdAC"); String sle=rs.getString("Sleeper"); model.addRow(new Object[]{tn,tname,fac,sac,tac,sle}); } } catch(Exception e){ JOptionPane.showMessageDialog(rootPane, "error"); } CODE FOR GET TICKET BUTTON Book h=new Book(); h.setVisible(true); CODE FOR BACK BUTTON Trainbtwstations b=new Trainbtwstations(); b.setVisible(true); CODE FOR HOME BUTTON OnlineReservation b=new OnlineReservation(); b.setVisible(true);
  • 10. CODE FOR COMBO BOX if(c1.getSelectedIndex()==0) t1.setText("" +3245); else if(c1.getSelectedIndex()==1) t1.setText("" +2345); else if(c1.getSelectedIndex()==2) t1.setText("" +2931); else if(c1.getSelectedIndex()==3) t1.setText("" +8412); else if(c1.getSelectedIndex()==4) t1.setText("" +3429); else if(c1.getSelectedIndex()==5) t1.setText("" +7103);
  • 11. BOOK TICKET FRAME CODE: IMPORT FILES: import java.sql.*; import java.sql.DriverManager; import java.sql.Statement; import javax.swing.JOptionPane; CODE FOR SUBMIT BUTTON String tno=t2.getText(); String tname=(String)c2.getSelectedItem(); String source=(String)classs1.getSelectedItem(); String des=(String)classs2.getSelectedItem(); String name=t5.getText(); String cla=(String)classs.getSelectedItem(); String age=t7.getText(); String contact=t6.getText();
  • 12. String sex=""; if(Male.isSelected()){ sex="Male"; } else if(Female.isSelected()){ sex="Female"; } else if(other.isSelected()){ sex="Other"; } String date=t1.getText(); Connection con=null; try{ Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/railway","root","root"); if(con!=null){ Statement stmt=con.createStatement(); int pnr=100000; ResultSet rs=stmt.executeQuery("select pnr from book order by pnr desc limit 1"); while(rs.next()){ pnr=rs.getInt("pnr"); } pnr++; String query="insert into book values("+pnr+","+tno+",'"+tname+"','"+source+"','"+des+"','"+cla+"','"+name+"',"+contact+", "+age+",'"+sex+"','"+date+"')"; int r=stmt.executeUpdate(query); if(r!=0){
  • 13. ResultSet rs1=stmt.executeQuery("select "+cla+" from avail where TrainNo="+tno); int no_seat=0; while(rs1.next()){ no_seat=rs1.getInt(1); } no_seat--; int r1=stmt.executeUpdate("update avail set "+cla+"="+no_seat+" where TrainNo="+tno); JOptionPane.showMessageDialog(rootPane, "Your pnr : "+pnr); if(r1!=0){ this.dispose(); new OnlineReservation().setVisible(true); } } else{ JOptionPane.showMessageDialog(rootPane, "booking not Possible / worng credentials: "); } } else{ JOptionPane.showMessageDialog(rootPane, "connection error "); } } catch(Exception e) { System.out.println(e); //JOptionPane.showMessageDialog(rootPane, "ERROR"); } } CODE FOR COMBO BOX
  • 14. if(c2.getSelectedIndex()==0) t2.setText("" +0000); else if(c2.getSelectedIndex()==1) t2.setText("" +3245); else if(c2.getSelectedIndex()==2) t2.setText("" +2345); else if(c2.getSelectedIndex()==3) t2.setText("" +2931); else if(c2.getSelectedIndex()==4) t2.setText("" +8412); else if(c2.getSelectedIndex()==5) t2.setText("" +3429); else if(c2.getSelectedIndex()==6) t2.setText("" +7103); CODE FOR BACK BUTTON Checkavailability b=new Checkavailability(); b.setVisible(true); CODE FOR HOME BUTTON OnlineReservation b=new OnlineReservation(); b.setVisible(true);
  • 15. CHECK TICKET FRAME CODE: IMPORT FILES: import java.sql.*; import java.sql.DriverManager; import java.sql.Statement; import java.sql.ResultSet; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; CODE FOR CHECK BUTTON String n=t1.getText(); String a=t2.getText(); DefaultTableModel model=(DefaultTableModel) tab1.getModel(); Connection con=null; try{ Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/railway","root","root"); if(con!=null){
  • 16. Statement stmt=con.createStatement(); ResultSet rs=stmt.executeQuery("SELECT pnr,tno,tname,class,name,age from book where (pnr = "+n+" and name = '"+a+"');"); if(rs.next()) { String po=rs.getString("pnr"); String to=rs.getString("tno"); String tn=rs.getString("tname"); String cl=rs.getString("class"); String na=rs.getString("name"); String ag=rs.getString("age"); model.addRow(new Object[]{to,po,na,ag,tn,cl}); } else { JOptionPane.showMessageDialog(rootPane,"PNR or Name is wrong"); } } } catch(Exception e){ JOptionPane.showMessageDialog(rootPane, "error"); } CODE FOR HOME BUTTON OnlineReservation b=new OnlineReservation(); b.setVisible(true); CODE FOR CONFIRM BUTTON d1.setVisible(true);
  • 17. CANCEL TICKET FRAME CODE: IMPORT FILES: import java.sql.*; import java.sql.DriverManager; import java.sql.Statement; import java.sql.ResultSet; import java.sql.SQLException; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; CODE FOR CANCEL YOUR TICKET BUTTON String a=t1.getText(); String name=t2.getText(); String cla=(String)classs2.getSelectedItem(); String tno=t3.getText(); try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection ("jdbc:mysql://localhost:3306/railway","root","root"); Statement stmt=con.createStatement();
  • 18. //String query="delete from book where pnr='"+a+"' and name='"+name+"';"; int r=stmt.executeUpdate("delete from book where pnr='"+a+"';"); if(r!=0){ ResultSet rs1=stmt.executeQuery("select "+cla+" from avail where TrainNo="+tno); int no_seat=0; while(rs1.next()){ no_seat=rs1.getInt(1); } no_seat++; int r1=stmt.executeUpdate("update avail set "+cla+"="+no_seat+" where TrainNo="+tno); d3.setVisible(true); } else { d2.setVisible(true); } } catch(ClassNotFoundException e) { JOptionPane.showMessageDialog(rootPane, "ERROR"); } catch (SQLException e) { JOptionPane.showMessageDialog(rootPane, "ERROR"); } CODE FOR HOME BUTTON OnlineReservation b=new OnlineReservation(); b.setVisible(true);
  • 19. HOW TO CREATA A SQL FILE OF A DATABASE FROM COMMAND PROMPT This is the procedure to create a sql file from a database in mysql: 1. Open command prompt in admin mode. 2.Now change directory to the bin directory of the mysql. 3.Now type the below command in the command prompt and then enter the password of your mysql. 4.Press enter and now you can find your database sql file in the bin folder of mysql.
  • 20. HOW TO USE A SQL FILE FROM COMMAND PROMPT IN ANOTHER PC Procedure: 1.Open mysql and create database (give any name); 2.Now type command use “databasename”; 3.Now paste the .sql file in your bin folder of mysql. 4.Now open command prompt and change the directory to the bin directory of mysql. 5. now type the command as shown below