Sie sind auf Seite 1von 27

INFORMATICS PRACTICES

PROJECT

MOVIE TICKET BOOKING


ACKNOWLEDGMENT

I would like to take this opportunity to express my sincere gratitude to all


those who have helped me to complete this project.
First of all, I would like to thank the God almighty for helping me
throughout this project.
I do realise that its god’s grace that helped me to do the project in the
best manner.
I extent my sincere thanks to Chavara Public School, which provided me
with the opportunity to fulfil my wish and achieve my goal. I cannot
move-on without thanking beloved Principal Fr. Mathew Kareethara CMI,
for creating the required academic environment, which made my task
appreciable. I would like to express deep debt to Mrs Jeena Seby, Mrs
Jancy Jacob, Mr Anand Joseph Jacob, and Mr Prakash K.K, for their
vital suggestions meticulous guidance and constant motivation which
went a long way in the successful completion of this project.
My deepest gratitude to my beloved parents who have been an
inspiration and have provided me with unrelenting encouragement and
support. Last but not the least, I thank each one of my classmates who
gave me valuable suggestions and helped with my project.

THANK YOU

Name:

Signature:
CONTENTS

 SYNOPSIS

 FRONTEND : NETBEANS

 BACKEND : MySQL

 CODING SESSIONS

 BIBLIOGRAPHY
NETBEAN IDE (JAVA)

Java is a general-purpose computer programming language that


is concurrent, class-based, object-oriented, and specifically designed to
have as few implementation dependencies as possible. It is intended to
let application developers “write once, run anywhere” (WORA),
meaning that compiled Java code can run on all platforms that support
Java without the need for recompilation. Java applications are typically
compiled to bytecode that can run on any Java virtual machine (JVM)
regardless of the computer architecture. Java was one of the
most popular programming languages in use particularly for client-
server web applications. Java was originally developed by James
Gosling at Sun Microsystems (which has since been acquired by
Oracle) and released in 1995 as a core component of Sun
Microsystems' Java platform. The language derives my of its syntax from
C and C++, but it has pure low level facilities than either of them.

There were five primary goals in the creation of the Java language:

1. It must be simple, object-oriented, and familiar.


2. It must be robust and secure.
3. It must be architecture-neutral and portable.
4. It must execute with high performance.
5. It must be interpreted, threaded, and dynamic.
JAVA JVM and BYTECODE

One design goal of Java is portability, which means that programs written for
the Java platform must run similarly on any combination of hardware and
operating system with adequate run time support. This is achieved by
compiling the Java language code to an intermediate representation called
Java bytecode, instead of directly to architecture-specific machine code. Java
bytecode instructions are analogous to machine code, but they are intended to
be executed by a virtual machine (VM) written specifically for the host
hardware. End users commonly use a Java Runtime Environment (JRE) installed
on their own machine for standalone Java applications, or in a web browser for
Java applets.

The advantages of Java are as follows:

 Java is easy to learn. Java was designed to be easy to use and is


therefore easy to write, compile, debug, and learn than other
programming languages.
 Java is object-oriented. This allows you to create modular programs and
reusable code.
 Java is platform-independent.

The disadvantages of Java are as follows:

 Java is slow.
 Java takes more memory space.
 Java’s architecture code is inefficient.
 No back-up.
MySQL

MySQL is an open-source relational database management system (RDBMS).


Its name is a combination of "My", the name of co-founder Michael Widenius's
daughter, and "SQL", the abbreviation for Structured Query Language. The
MySQL development project has made its source code available under the
terms of the GNU General Public License, as well as under a variety of
proprietary agreements. MySQL was owned and sponsored by a single for-
profit firm, the Swedish company MySQL AB, now owned by Oracle
Corporation. For proprietary use, several paid editions are available, and offer
additional functionality.
HOME PAGE

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


NewJFrame1 obj=new NewJFrame1();
obj.show();
this.hide();
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
NewJFrame3 obj=new NewJFrame3();
obj.show();
this.hide();
}
LOGIN

LOGIN BUTTON

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


try{
Class.forName("com.mysql.jdbc.Driver");
Connection con=
DriverManager.getConnection("jdbc:mysql://localhost:3306/manasa?zeroDate
TimeBehavior=convertToNull","root","");
String query ="select password from login where
userid='"+jTextField1.getText()+"';";
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery(query);
String pwd=new String(jPasswordField1.getPassword());
if(rs.next())
if(pwd.equalsIgnoreCase(rs.getString(1)));
{
JOptionPane.showMessageDialog(null,"entered");
NewJFrame3 obj=new NewJFrame3();
obj.show();
this.dispose();
}
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e.getMessage());
}
}

CREATE BUTTON

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


NewJFrame2 obj=new NewJFrame2();
obj.show();
this.dispose();
}
catch(Eeception e)
{
JOptionPane.showMessageDialog(null,”error”);
}
}

UPDATE BUTTON

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/manasa?zero
DateTimeBehavior=convertToNull","root","" );
Statement stmt=con.createStatement();
String p =new String(jPasswordField1.getPassword());
String query="Update login set password='"+p+"'where
userid='"+jTextField1.getText()+"';";
stmt.executeUpdate(query);
System.out.println(query);
JOptionPane.showMessageDialog(null,"UPDATED");

}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,e.getMessage());
}
}
REGISTER

PROCEED BUTTON

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/manasa","ro
ot","");
Statement stmt=con.createStatement();
String pwd=new String(jPasswordField1.getPassword());
String query="insert into login values('"+jTextField1.getText()+"','"+pwd+"');";
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Record Added");
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,e.getMessage());
}
}

SEAT BOOKING

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/manasa?zero
DateTimeBehavior=convertToNull","root","");
Statement stmt=con.createStatement();
String query="insert into bookings
values('"+jTextField1.getText()+"','"+jTextField2.getText()+"',"+jTextField3.getT
ext()+",'"+jTextField4.getText()+"');";
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Booking Done");
NewJFrame4 obj=new NewJFrame4();
obj.show();
this.dispose();
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"error");
}

}
CHOOSE YOUR MOVIE

BOOKING CANCELLATION

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


try{
String n=JOptionPane.showInputDialog(null,"ENTER NAME");
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/manasa?zero
DateTimeBehavior=convertToNull","root","");
Statement stmt=con.createStatement();
String query="delete from bookings where name='"+n+"';";
int x=JOptionPane.showConfirmDialog(null,"Are you sure you want to cancel
your booking?");
if(x==JOptionPane.YES_OPTION)
{
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Booking Cancelled");
HOME obj=new HOME();
obj.show();
this.dispose();

}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"error");
}

private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {


VIRUS m=new VIRUS();
m.show();
this.hide();

SEAT BOOKINGS
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
NewJFrame5 obj=new NewJFrame5();
obj.show();
this.dispose();
}

BACK
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
NewJFrame4 obj=new NewJFrame4();
obj.show();
this.dispose();
}
private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {
TAKEN m=new TAKEN();
m.show();
this.hide();
}

SEAT BOOKINGS
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
NewJFrame5 obj=new NewJFrame5();
obj.show();
this.dispose();
}

BACK
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
NewJFrame4 obj=new NewJFrame4();
obj.show();
this.dispose();
}

private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {


charlie m=new charlie();
m.show();
this.hide();
}

SEAT BOOKINGS
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
NewJFrame5 obj=new NewJFrame5();
obj.show();
this.dispose();
}

BACK
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
NewJFrame4 obj=new NewJFrame4();
obj.show();
this.dispose();

private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {


taarezameenpar m=new taarezameenpar();
m.show();
this.hide();
}
SEAT BOOKINGS
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
NewJFrame5 obj=new NewJFrame5();
obj.show();
this.dispose();
}

BACK
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
NewJFrame4 obj=new NewJFrame4();
obj.show();
this.dispose();

CALCULATE BUTTON
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int seat=Integer.parseInt(jTextField1.getText());
int rate=0;
if(jRadioButton1.isSelected())
rate=300;
if(jRadioButton2.isSelected())
rate=200;
if(jRadioButton3.isSelected())
rate=100;
jTextField2.setText(""+rate);
int amt=rate*seat;
jTextField3.setText(""+amt);
}
PROCEED BUTTON

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {


NewJFrame6 m= new NewJFrame6();
m.show();
this.hide();
}

BACK BUTTON

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


NewJFrame4 m=new NewJFrame4();
m.show();
this.hide();
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


int rate=0;
String val=jList1.getSelectedValue();
if(val.equals("POPCORN"))
rate=30;
if(val.equals("NACHOS"))
rate+=60;
if (val.equals("ROLLS"))
rate+=100;
if(val.equals("SANDWICHES"))
rate+=90;
String drink=jList2.getSelectedValue();
if(drink.equals("TEA"))
rate+=20;
if(drink.equals("COFFEE"))
rate+=30;
if(drink.equals("COLD DRINKS"))
rate+=15;
if(drink.equals("WATER"))
rate+=10;
jTextField1.setText(""+rate);

FINAL PAYMENT

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


NewJFrame7 obj= new NewJFrame7();
obj.show();
this.hide();
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
if(jRadioButton1.isSelected())
JOptionPane.showMessageDialog(null,"AMOUNT WITHDRAWN....ENJOY
YOUR SHOW");
if(jRadioButton2.isSelected())
JOptionPane.showMessageDialog(null,"AMOUNT WITHDRAWN....ENJOY
YOUR SHOW");
}

SQL QUERIES

show create table login;


---------------------------+
| Table | Create Table
|
+-------+-------------------
| login | CREATE TABLE `login` (
`userid` varchar(30) DEFAULT NULL,
`password` varchar(30) DEFAULT NULL
--------------------------------

select * from login;


+--------+----------+
| userid | password |
+--------+----------+
| neenu | pet |
| anju | movie |
| niya | life |
| manu | sky |
| riya | lord |
+--------+----------+

show create table bookings;


----------------------------
| Table | Create Table
+----------+-------------------
| bookings | CREATE TABLE `bookings` (
`name` varchar(20) DEFAULT NULL,
`address` varchar(20) DEFAULT NULL,
`phno` int(10) DEFAULT NULL,
`email` varchar(20) DEFAULT NULL
)

select * from bookings;


+-----------+------------+----------+----------------+
| name | address | phno | email |
+-----------+------------+----------+----------------+
| sai | mumbai | 53778493 | sai@gmail.com |
| maheswari | trivandrum | 54175412 | mahi@yahoo.com |
+-----------+------------+----------+----------------+
BIBILIOGRAPHY

http://www.codefreetutorial.com/learn-mysql/79-what-is-mysql

https://howtodoinjava.com/java/basics/what-is-java-programming-language/

https://en.wikipedia.org/wiki/MySQL

https://en.wikipedia.org/wiki/Java_(programming_language)

Das könnte Ihnen auch gefallen