Professional Documents
Culture Documents
PROJECT REPORT
ON
DREAM CODER
Submitted in partial fulfillment of the requirements
For the award of the degree of
Roll no (1670370140)
MBA
DECLARATION
We hereby declare that this submission is our own work and that, to the best
of knowledge and belief, it contains no material previously published or
written by another person nor material which to a substantial extent has
been accepted for the award of master degree of the university or other
institute of higher learning, except where due acknowledgement has been
made in the text.
Signature:
Date :
Project In charge
Project Guide
Head of Department ,
We owe our deepest gratitude to the Head of the Department of M.B.A (IT),
Project In charge Ms Priti Kumari and our Hemant Joshi sir for giving us an
ample opportunity to carry out this Project.
Thanking you,
VIPIN KUMAR
(1670370140)
generations may view our era as the time when people developed tools to
Use of computer has grown immensely over the past few decades.
Computers are being used in every sphere of modern life to make better use of
time and space as they form the base of almost every third organization
and/or department. With the requirements and ease of use increasing every
day, the computer industry has seen some radical improvements in software
development tools.
overall problem. Every individual has different needs and it is very difficult to
they want. In this era of evolution, there are good software which are easy to
use and work with, and they do not need much learning.
the accurate and complete information about what the “ DREAM CODER” is all
about?
working in CRIS New Delhi, for his encouragement, guidance and valuable
I dedicate the whole project work to Mr. Arun Singh, who has always
development process.
And last but not the least I thank my parents and all my friends who
not only encouraged me but also helped me in the process of making this
project.
Thanking All
VIPINKUMAR
VIPIN KUMAR 5 1670370140
1670370140
development solutions and also considerably reduce the time, effort and costs of
process development.
can't effectively meet today's requirements, users needing more powerful and
databases.
Environment (IDE) for Oracle Databases. Using the intuitive “DREAM CODER”
GUI will increase your code quality and reduce the development process time.
“DREAM CODER” for Oracle easily enables you to build and execute
queries, build and execute scripts, compile and debug SQL code, create and
modify database objects, import and export data, enable and database
The computer has change the way we work learn and communicate virtually
decision-making.
VIPIN KUMAR 9 1670370140
Most software products implement support for My SQL databases,
popular My SQL Manager application, My SQL Turbo Manager is by far the best
can't effectively meet today's requirements, users needing more powerful and
databases.
The project report for this system provides a comprehensive view of the overall
The project report is divided into number of sections. The very first
proposed system.
The second section gives detail information of all database design process.
with the help of data dictionary and other diagrams. Various requirements and
constraints have also been discussed. The biggest portion of this report is
2005. The structure of the interface is designed to provide several facilities along
with the process for data storage, easy maintenance and retrieval of
information, reports generation and a mean for analysis of the system outputs
for better performance. The entire system is divided into several modules driven
retrieve and update the data without writing a single code. A user
can easily create his own databank and store his/her data in
as locate one’s own data. The key goal behind developing this
OBJECTIVES
and productive.
sources simultaneous.
Plug-ins support and set of free plug-ins will add flexibility to your
search).
security on data.
Advanced “DREAM CODER” makes your work with script easy and
comfortable.
DREAM CODER’s GUI will increase your code quality and reduce the
database immediately.
Software Tools :-
Front-end Tool :
In this project “JAVA” has been chosen as the Front-end tool for the process
of software development.
facts:-
The JDBC API is designed to allow developers to create JAVA code that
rewrite their code. Despite standards set by the ANSI committee, each
database system vendor has a unique way of connecting to its system. Any
type of JAVA code, including JAVA Servlets, JSP Pages, Enterprise JAVA
The JDBC API is designed to allow developers to create JAVA code that
rewrite their code. Despite standards set by the ANSI committee, each
database system vendor has a unique way of connecting to its system. Any
type of JAVA code, including JAVA Servlets, JSP Pages, Enterprise JAVA
The JDBC API was first introduced with release 1.1 of JDK. JDK 1.5
contains JDBC 3.0 which of the composed of the JAVA.SQL and JAVAX.SQL
uniform and database independent. The API provides a standard to write to,
as well as standard that takes all of the various application ensigns into
account.
standard JDBC calls into the specific calls required by the database it
supports. The application is written once and then moved to the various
drivers. The application remains the same; the driver change. Driver may be
independent framework.
JDBC drivers must support ANSI SQL-2 entry level, but JDBC allows to
strings may or may not be ANSI SQL or SQL at all. The use of these strings
is up to underlying driver.
interface. Both JDBC and ODBC however are based on the X/open SQL
Swing is a set of packages built on the top of the AWT that provides you
components).
The Swing API has many classes for creating various types of user
interface elements. The swing family tree is spilt in such a way that the
component class is divided into two – the group of the classes derived from
Jcomponents class and another that descends from the Window classes.
Object
Object
Components
Component
Container
Container
Window
Window Jcompone
Jcompone
nt
nt
Frame
Frame
JFrame
JFrame JApplet
JApplet JPanel
JPanel JList
JList JRootPa
JRootPa JMenu
JMenu
ne
ne
Borders
Graphics debugging
Tooltips
Easy Scrolling
serve up HTML pages. Those interlinked pages were dubbed the World Wide
Web (WWW), and several web browser programs had been written to allow
people to view web pages. Because the popularity of the Web, a few
selling one of the world’s most popular Web browser, Netscape Navigator.
Today HTML pages are the standard interface to the internet. They can
and good old fashioned text. Millions of Web pages are retrieve each day
BACKEND TOOL
VIPIN KUMAR 21 1670370140
MySQL, the most popular Open Source SQL database management
generation Open Source Company that unites Open Source values and
in a
MySQL Server. Since computers are very good at handling large amounts of
all the data in one big storeroom. This adds speed and flexibility. The SQL
part of “MySQL” stands for “Structured Query Language.” SQL is the most
the ANSI/ISO SQL Standard. The SQL standard has been evolving since
1986 and several versions exist. In this manual, “SQL-92” refers to the
1999, and “SQL: 2003” refers to the current version of the standard. We use
the phrase “the SQL standard” to mean the current version of the SQL
Open Source means that it is possible for anyone to use and modify
the software. Anybody can download the MySQL software from the Internet
and use it without paying anything. The MySQL software uses the GPL
define what you may and may not do with the software in different
situations.
much faster than existing solutions and has been successfully used in highly
constant development, MySQL Server today offers a rich and useful set of
functions. Its connectivity, speed, and security make MySQL Server highly
product.
ORACLE10g – As a Back-end:
professionals.
suite of tools that are being used to capture. Validate and display
manipulation of data
The owner of the object can take privileges once given. Oracle-8 i
provides an interactive SQL tool, which allows users to enter ANSI SQL
sentences and pass them to the Oracle Engine for execution. These
sentences allow the user to create access and maintain data structures
like tables, indexes etc.
Oracle-8i provides fast access to SQL even when there are thousands
of data.
An Oracle Instance
Multiple-process Oracle instance.
is good enough to know that your data is put into a database and not worry
about the details. We will be explaining databases and other key Access
specify what kind of data you will be storing. A retail business might
create a database to store all their sales information (i.e. items sold,
2. Data Input: After your database is created the data the store gathers
various processes and to find out its requirements. These may include
mind.
System elements.
refine the software allocation and build models of the data, functional
specification provides the developer and the customer with the means
understood.
Implementation detail.
the firm wants from the proposed system. All the analysis was done in
the system.
The need for the proposed project has arisen because oracle is not a
There are so many users who don’t know how to make a query.
For getting any information user needs some help of programmers and
the programmers are not available all time.
made:
REQUIREMENT SPECIFICATION
The need for the proposed project has arisen because oracle is not a
There are so many users who don’t know how to make a query.
For getting any information user needs some help of programmers and
the programmers are not available all time.
made:
o Proper software can solve the above given problems since it can
ACTION DAYS
Synopsis Preparation 5
Tool Learning 10
Project(Analysis,Coding,Testing) 24
Documentation 6
TOTAL 45 days
Table opened
Table deleted
Table altered
Table renamed
2.0
Record inserted
USER MANIPULATE
Table deleted
View dropped
1.2
Table designed TABLE
DESIGN
1.3
Table deleted TABLE
DELETE
1.7
Structure viewed TABLE
STRUCTURE
VIPIN KUMAR
SECOND42 LEVEL DFD 1670370140
SECOND LEVEL DFD (CONTINUED)
VIEW
M
CONDITION
HAS S
N NAME
MANIPULATE
RIGHTS
CONDITION
M
ADVANCED FUNTION
ASSIG
N S
1
DBA
PL/SQL PROGRAMMI-
NG
1 LANGUAGE
HAS
VARIOUS
RIGHTS ER-DIAGRAM
VIPIN KUMAR 46 1670370140
PRELIMINIARY PRODUCT DESCRIPTION
existing system and providing a visual solution . The key goal behind
database and performing various operations on it. As all users are not
Very often when the customer put his demand for any system, the
questions are asked to managers, person who will use the system. All the
necessary details required in the analysis of project are collected from the
Following questions are asked to the user to find out the major heading that
investigation.
FEASIBILITY STUDY
The extent of the feasibility study depends on the size and nature of
the system.
Management
Systems personnel
Users
The feasibility study and its updates are used by the steering
Proceed
determine the feasibility involved in the developed system so that the new
whether or not a project is not worth doing. The project followed in making
if a project can and should Be Taken. Once it has been determined that
project is feasible, the analyst can go ahead and prepare the project
contractual obligations?
possible.
that the product will perform and to verify that there are no production
barriers.
must be completed.
Assessment:-
equipment and software that will successfully satisfy the user requirement.
system. The technical needs of the system may very considerably, but
might include:
If they are not available, can they be upgraded to provide the level of
given more importance than the actual make of hardware. The configuration
should give the complete picture about the system’s requirements: How
many workstations are required, how these units are interconnected so that
2) Operational Feasibility: -
available to operate the system once it has been installed. Users that
the organization. This test of feasibility asks if the system will work
From user? If the present system is well liked and used to the
extent that persons will not be able to see reasons for change, there
may be resistance.
Are current business methods acceptable to the user? If they are not,
user may welcome a change that will bring about a more operational
Have the user been involved in the planning and development of the
Will the proposed system cause harm? Will it produce poorer result in
any case or area? Will the performance of staff member fall down
after implementation?
Issue that appears to be quite minor at the early stage can grow into
keeping mind that it should be user friendly and easy to operate hence
Operating costs
Other costs
the context of direct and indirect benefits and costs to the organization
savings that are expected from a purposed system and compare with
each phase of the system life cycle. The analysis part also clears the
system.
PROJECT PLANNING
Objectives:-
Client workstation.
The activities in the system, after including the provisions for security are:
verifications of software
analysis : 22-MAR-2011—05-APR-2011
design : 06-APR-2011—26-APR-2011
coding : 27-APR-2011—03-MAY-2011
testing : 04-MAY-2011—21-MAY-2011
documentation : 22-MAY-2011—24-MAY-2011
SCHEDULING
various tasks (jobs) with respect to their cost, time, and duration.
implementation.
Scheduling techniques
approach. A tree like structure is followed without any loops. At each phase
requirements. The work breakdown structure shows the overall breakup flow
of the project and does not indicate any parallel flow. Work breakdown
Here the project is split into Analysis, Design, Coding and Testing
(DREAM CODER)
SOFTWARE
REQUIREMENT BLACK BOX
FEASIBILITY
SPECIFICATIO COMMENTS& TESTING
STUDY
N
DESCRIPTION
PROJECT VALIDATION
PLANNING AND GLASS BOX
CHECKS
STANDARISATION TESTING
SCHEDULING
OF CODING
PROCEDURAL ARCHITECTUR
ERROR
DESIGN E DESIGN HANDLING
USER
INTERFACE
(days) DATE
1. SYNOPSIS 18/2/2011
PREPARATION
5 7/2/2011
2. 21/3/2011
22/3/2011
4. Design 10 26/4/2011
24
5/4/2011
5. Coding 8 27/4/2011 3/5/2011
Pert chart
Pert provide quantitative tool that allow the software planner to-
task.
Preliminary 2
Investigation
Dum Testing
my Design Coding
1
4 5 6 7 8
2 2
Data collection
(0,10) 3 Analysis
1
(12,27)
the system can prepare SRS after detail communication with the customer.
PURPOSE
the finding of analysis stage to the design stage. The SRS includes:
Interface
VIPIN KUMAR 66 1670370140
logical database
Hardware
General information
15 ‘SVGA’colored monitor
Software
Crystal reports
No hidden buttons
Functional requirement
The administrator and the parties should be able to view all details.
updated by user.
Performance
Reliability
Efficiency
Usability
Portability
Testability
Understandability
Modifiability
Uploads data
In this project, Spiral model is used for the development. Spiral model
populated by a set of work tasks called a task set that are done according to
number of tasks and their formality is low. Conversely, for large projects the
reverse is true.
In this task region customers are asked about their requirements from the
Planning:- This task is basically done to define resources, time lines and
other project related information. In this task region resource, timelines and
taken
Risk analysis:- This task is basically done to assess both technical and
install and provide user support (e.g., documentation and training). In this
provided.
during the engineering stage and implemented during the install stage in
this region, feedback is taken from the customer about the overall
deliverable. For example, the first and second spiral traversals may result in
this way a more stochastic version of the software is produced after some
subsequent traversal. A key difference between the spiral model and other
software models is that risk analysis is performed in former and not in later.
better software.
Thus according to the steps of spiral model first of all following steps are
requirement collected).
As the information, the user wants to put on the software and
reduced.
After designing and creation of some pages of site, a feedback is
completely developed.
SYSTEM DESIGN
The design of the system is most critical factor affecting the quality of
the software; it has major impact on the phases particularly testing
solution.
System Design
Detailed Design
Database design
SYSTEM DESIGN:-
System design aims to identify the modules there should be in the
system, the specification of these modules and how they interact with
VIPIN KUMAR 76 1670370140
each other to produce the desired result. At the end of system design
all the major data structures, file formats and the major modules in
DETAILED DESIGN:-
During detailed design, the internal logic of each of the modules
DATABASE DESIGN:-
A database may be thought of a set of related files. Related
files mean that records in another file. The conventional file based
systems emphasized that the application and the files were built
of application that use the data. The application are allowed evolve
around a database design such that it can adopt the changing needs.
MySQL MODULE
ORACLE MODULE
MS-ACCESS MODULE
NUMBER OF MySQLMODULES
1. Login.
2. Table.
Create Table.
Open Table
Alter Table
VIPIN KUMAR 79 1670370140
Add New Fields
Modify Column
Rename Table
Delete Table
3. Advanced
Data Structure
Sorting
3. Manipulate
Insert Record.
Delete Record
4. View
Create View
Delete View.
Drop User
6 Schema
Drop Schema
1. Login.
2. Table.
Create Table.
Alter Table
Modify Column
Rename Table
Delete Table
3. Manipulate
Insert Record.
Delete Record
4. View
Create View
Delete View.
Drop User
1. Login.
2. Table.
Create Table.
Open Table
Rename Table
VIPIN KUMAR 83 1670370140
Delete Table
3. Manipulate
Insert Record.
Delete Record
DETAILS OF MODULES
record
VIPIN KUMAR 84 1670370140
Alter Table:- It is used to modify data structure of
existing table.
of existing column.
existing table.
existing table.
DBA rights.
Oracle.
some criteria.
update.
View
selected table.
Advanced
most cases, there is no way for the database vendor to know ahead of time
what our data storage needs are, chances are that we will need to create
tables in the database. Many database tools allow us to create tables without
writing SQL, but given that tables are the container of all the data, it is
divided into rows and columns. Each row represents one piece of data, and
data. So, for example, if we have a table for recording customer information,
then the columns may include information such as First Name, Last Name,
Address, City, Country, Birth Date, and so on. As a result, when we specify a
table, we include the column headers and the data types for that particular
column.
Table options:-
structures.
VIPIN KUMAR 87 1670370140
Syntax:- CREATE TABLE "table_name" column 1"
HELP:
box. You can add more fields after pressing add button.
we would type in
(First_Name char(50),
Last_Name char(50),
Address char(50),
City char(50),
Country char(25),
Birth_Date date)
drop a column
VIPIN KUMAR 89 1670370140
syntax:- ALTER TABLE table_name RENAME TO new_table_name;
In above syntax:
TABLE dept_90
Drop a column
Add Column:
You can add a new column by executing this query. First select the
table in which you want to add column. Give the name of column
In above syntax:
Example:
Modify Column:
You can modify an existing column ( i.e you can change column’s
datatype, size, name) by executing this query. First select the table
in which you want to modify column. Give the name of column that
Syntax:
In above syntax:
Example:
Drop Column:
want to drop a column. Give the name of column that you want to
In above syntax:
Example:
Update Table:
Syntax:
UPDATE table
WHERE condition;
Example:
UPDATE employees
that you want to rename and then specify the new name that you
In above syntax :
for the DBA's. Fortunately, SQL allows us to do it, as we can use the
table. When you drop a table, the database loses all the data in the
example:- we will drop the above table which is given in the previous
example
account through which you can log in to the database, and to establish the
means by which Oracle Database permits access by the user. The DBA
creates the user by executing the CREATE USER statement. The user does
not have any privileges at this point. The DBA can then grant privileges to
that user. These privileges determine what the user can do at the database
level.
VIPIN KUMAR 95 1670370140
syntax:- CREATE USER username SET PASSWORD ‘password'[ SET
In the syntax:
Password specifies that the user must log in with this password
the ability to grant users access to the database and its objects. The
related privileges.
Database security:
System security
Data security
objects.
sequences
available for users and roles. System privileges typically are provided
schema.
Privileges
User System Privileges:- Once a user is created, the DBA can grant
PUBLIC...];
In the syntax:
User |role|PUBLIC is the name of the user, the name of the role, or
PUBLIC
An application developer, for example, may have the following system privilege
schema
allocate system privileges to the user. Once the user has been granted
view TO scott;
Grant succeeded.
In the example on the slide, user Scott has been assigned the privileges to
of Oracle.
of any user.
Options of Manipulate ?
example:INSERTINTOStore_Information(store_name,sales,Date)VAL
criteria.You can remove existing rows from the table by using the
delete statement. First select the table From which you want to delete
record.
view contains no data of its own but is like a window through which data
from tables can be viewed or changed. The tables on which a view is based
are called base tables. The view is stored as a SELECT statement in the data
dictionary.
Views restrict access to the data because the view can display
a join statement.
Views provide data independence for ad hoc users and application
programs. One view can be used to retrieve data from several tables.
Views provide groups of users access to data according to their
particular criteria
simple
complex
View Options
Can be a simple view, based on one table
VIPIN KUMAR 103 1670370140
Can be a complex view based on more than one table or can contain
groups of functions
Can replace other views with the same name
Can contain a check constraint
Can be read-only
WHERE Discontinued=No.
You can retrieve data from a view as you would from any table. You can
display either the contents of the entire view or just specific rows and
columns.
become invalid. Only the creator or a user with the DROP ANY VIEW
any table.
Data Structure
Rest of the tables, views and synonyms are created at run time
1 UserName Varchar2 30
2 DateLogin Varchar2 15
3 TimeLogin Varchar2 15
1 F1 Varchar2 40
2 F2 Varchar2 40
3 F3 Varchar2 75
4 F4 Varchar2 40
5 F5 Varchar2 40
6 F6 Varchar2 40
QUERIES
1 UserName Varchar2 30
2 DateLogin Varchar2 15
3 TimeLogin Varchar2 15
PROCESS LOGIC
LOGIN:-No user name will be displayed automatically to the user. User has
and after 5 second “Main form” opens automatically else an error message
will be flashed.
VIPIN KUMAR 107 1670370140
TABLE:-
and its size. If all the entries are valid then table is created else
and select the old table to create a new table including data or not.
modified along with its fieldname and new details. Finally table is
altered.
to be deleted.
DBA UTILITIES:-
CREATE NEW USER:-Any DBA can create new user. DBA has
to input “user name” and type appropriate password for user
created.
and DBA.
dropped.
names and its content will be displayed in a grid and finally you
names and its content will be displayed in a grid and user has to
will be displayed.
the table names and its content will be displayed in a grid and
VIEW:-
dropped.
ADVANCED:-
automatically. User has to select table name then all fields are
shown in list then user has to select the desired fields and click
on print. If all entries are valid then crystal report will created.
HELP:-
developed.
LOGIN:-No user name will be displayed automatically to the user. User has
and after 5 second “Main form” opens automatically else an error message
will be flashed.
TABLE:-
and its size. If all the entries are valid then table is created else
and select the old table to create a new table including data or not.
modified along with its fieldname and new details. Finally table is
altered.
to be deleted.
DBA UTILITIES:-
CREATE NEW USER:-Any DBA can create new user. DBA has
to input “user name” and type appropriate password for user
created.
dropped.
MANIPULATE:-
dropped.
ADVANCED:-
all fields are shown in list then user has to select the desired
fields and click on print. If all entries are valid then crystal
Console.
START UP FORM
package com.db;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
com1=new JComboBox();
com1.addItem("NONE");
com1.addItem("MYSQL");
com1.addItem("MS ACCESS");
com1.addItem("ORACLE");
cmd1.addActionListener(new ActionListener()
StartUpForm.this.setVisible(false);
});
cmd2=new JButton("PROCEED");
this.getRootPane().
setDefaultButton(cmd2);
cmd2.addActionListener(new ActionListener()
Stringdb=com1.getSelectedItem().toString().toUpperCase(
);
StartUpForm.this.setVisible(false);
if(db.equals("MYSQL"))
p.pack();
StartUpForm.this.setVisible(false);
if(db.equals("ORACLE"))
f.pack();
StartUpForm.this.setVisible(false);
if(db.equals("MS ACCESS"))
StartUpForm.this.setVisible(false);
});
this.initLabel();
this.initButton();
this.initCombobox();
p1.setBorder(BorderFactory.createTitledBorder(""));
p1.add(com1);
p1.add(cmd1);
VIPIN KUMAR 131 1670370140
p1.add(cmd2);
this.getContentPane().add(p1,BorderLayout.SOUTH);
p2=new JPanel();
p2.setBorder(BorderFactory.createTitledBorder(""));
p2.add(l1);
this.getContentPane().add(p2,BorderLayout.NORTH);
public StartUpForm()
this.initComponent();
this.setSize(350,350);
//this.setLocation(250,250);
this.setVisible(true);
Helper.setPosition(this);
try
UIManager.setLookAndFeel(newcom.birosoft.liquid.LiquidL
ookAndFeel());
SwingUtilities.updateComponentTreeUI(p);
p.pack();
catch(Exception e){}
}}
package com.db;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.sql.Connection;
import java.sql.DriverManager;
{
VIPIN KUMAR 134 1670370140
cmd1=new JButton("Browse");
cmd2=new JButton("Proceed");
this.getRootPane().setDefaultButton(cmd2);
cmd2.addActionListener(new ActionListener()
try
MsAcessQueryBrowserFormf=newMsAcessQueryBrowserForm(cn)
MsAcessLoginForm.this.setVisible(false);
catch(Exception e)
JOptionPane.showMessageDialog(null,"Login
Failed...Retry\n\n");
});
cmd1.setEnabled(false);
cmd2.setEnabled(false);
cmd3.addActionListener(new ActionListener()
MsAcessLoginForm.this.setVisible(false);
});
cmd1.addActionListener(new ActionListener()
try
JFileChooser ch=new
JFileChooser();
ch.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
ch.showOpenDialog(null);
txt1.setText(file.getAbsolutePath());
path=file.getAbsolutePath()+"\\"+txt2.getText()+".mdb";
if(!temp.exists())
JOptionPane.showMessageDialog(null,path);
FileInputStream
fis=new FileInputStream("lib/Temp.mdb");
FileOutputStream
fos=new FileOutputStream(path);
for(int
i=fis.read();i!=-1;i=fis.read())
fos.write(i);
fis.close();
fos.close();
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
cn=DriverManager.getConnection("jdbc:odbc:Driver={Micro
soft Access Driver (*.mdb)};DBQ="+path);
catch(Exception e)
JOptionPane.showMessageDialog(null,e.getMessage());
});
}
VIPIN KUMAR 138 1670370140
private void initLabel()
txt1=new JTextField(10);
txt1.setEditable(false);
txt2=new JTextField(10);
txt2.addKeyListener(new KeyAdapter()
if(txt2.getText().length()>0)
cmd1.setEnabled(true);
cmd2.setEnabled(true);
else
cmd1.setEnabled(false);
VIPIN KUMAR 139 1670370140
cmd1.setEnabled(false);
});
this.initLabel();
this.initTextField();
this.initCmdbutton();
p1.setBorder(BorderFactory.createTitledBorder(""));
p1.add(l1);
p2.setBorder(BorderFactory.createTitledBorder(""));
p2.add(l2);
p2.add(txt1);
p2.add(cmd1);
p3.add(l3);
p3.add(txt2);
p3.add(cmd2);
p3.add(cmd3);
this.getContentPane().add(p1,BorderLayout.NORTH);
this.getContentPane().add(p2,BorderLayout.CENTER);
this.getContentPane().add(p3,BorderLayout.SOUTH);
public MsAcessLoginForm()
this.initComponent();
this.setVisible(true);
this.setSize(350,350);
this.setLocation(300,300);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
VIPIN KUMAR 141 1670370140
}
package com.db;
import java.sql.Connection;
import java.sql.DriverManager;
this.url="jdbc:mysql://"+this.ip+":"+this.port+"/"+this.data
base;
this.ip="127.0.0.1";
this.port="3306";
this.database="mysql";
this.user="root";
this.password="";
this.makeUrl();
this.ip=ip;
this.port="3306";
this.database="mysql";
this.user="root";
this.password="";
this.makeUrl();
this.ip=ip;
this.port=port;
VIPIN KUMAR 144 1670370140
this.database="mysql";
this.user="root";
this.password="";
this.makeUrl();
this.ip=ip;
this.port=port;
this.database=database;
this.user="root";
this.password="";
this.makeUrl();
this.ip=ip;
this.port=port;
this.database=database;
this.user=user;
this.password="";
VIPIN KUMAR 145 1670370140
this.makeUrl();
this.ip=ip;
this.port=port;
this.database=database;
this.user=user;
this.password=password;
this.makeUrl();
Connection cn=null;
try
Class.forName("com.mysql.jdbc.Driver");
cn=DriverManager.getConnection(this.url,this.user,this.
password);
catch(Exception e)
VIPIN KUMAR 146 1670370140
{
this.ERROR=e.getMessage();
return cn;
Connection cn=null;
try
Class.forName("com.mysql.jdbc.Driver");
cn=DriverManager.getConnection(this.url,this.user,this.
password);
if(!cn.isClosed())
cn.setAutoCommit(commitMode);
catch(Exception e)
this.ERROR=e.getMessage();
return cn;
this.ip=ip;
this.makeUrl();
this.port=port;
this.makeUrl();
this.database=database;
this.makeUrl();
this.user=user;
this.makeUrl();
}
VIPIN KUMAR 148 1670370140
public void setPassword(String password)
this.password=password;
return this.ip;
return this.port;
return this.database;
return this.user;
return this.password;
return this.url;
CREATE TABLE
package com.db;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import java.sql.Connection;
model=new DefaultTableModel();
model.addColumn("FIELD");
model.addColumn("TYPE");
model.addColumn("SIZE");
model.addColumn("CONSTRAINT");
//model.addRow(new java.util.Vector());
//model.addRow(new java.util.Vector());
//model.addRow(new java.util.Vector());
//model.addRow(new java.util.Vector());
//model.addRow(new java.util.Vector());
VIPIN KUMAR 151 1670370140
//model.addRow(new java.util.Vector());
//model.addRow(new java.util.Vector());
//model.addRow(new java.util.Vector());
//model.addRow(new java.util.Vector());
//model.addRow(new java.util.Vector());
table=new JTable(model);
table.setPreferredScrollableViewportSize(new
Dimension(400,150));
txt1=new JTextField(10);
cmd1=new JButton("GENERATE");
model.addRow(new java.util.Vector());
String
a[]={"INTEGER","VARCHAR","DOUBLE","VARCHAR2","NUMBER","
TEXT","DATE/TIME"};
table.getColumnModel().getColumn(1).setCellEditor(new
DefaultCellEditor(new JComboBox(a)));
});
cmd3.addActionListener(new ActionListener()
model.removeRow(row);
});
cmd1.addActionListener(new ActionListener()
initQuery();
});
this.initButton();
this.initTabel();
this.initTextBox();
this.initLabel();
p1.add(l1);
p1.add(txt1);
this.getContentPane().add(p1,BorderLayout.NORTH);
p2.setBorder(BorderFactory.createTitledBorder("table"))
;
p2.add(new JScrollPane(table));
this.getContentPane().add(p2,BorderLayout.CENTER);
p3.setBorder(BorderFactory.createTitledBorder(""));
p3.add(cmd2);
p3.add(cmd3);
p3.add(cmd1);
this.getContentPane().add(p3,BorderLayout.SOUTH);
}
VIPIN KUMAR 155 1670370140
public void initQuery()
try
String str4="";
if(table.getRowCount()>0&&txt1.getText().length()>0)
String str2="";
for(int
i=0;i<table.getRowCount();i++)
String
field=table.getValueAt(i,0).toString();
String
type=table.getValueAt(i,1).toString();
String
size=table.getValueAt(i,2).toString();
String str=field+"
"+type+"("+size+") "+constraint;
str2=str2+str+" , ";
str="";
for(int i=0;i<=str2.length()-3;i+
+)
str4=str4+str2.charAt(i);
JOptionPane.showMessageDialog(null,str1);
PreparedStatement
ps=cn.prepareStatement(str1);
int a=ps.executeUpdate();
else
{
VIPIN KUMAR 157 1670370140
JOptionPane.showMessageDialog(null,"DATA NOT
ENTERED");
catch(Exception e)
JOptionPane.showMessageDialog(null,e.getMessage());
cn=con;
this.initPanel();
this.setTitle("CREATE TABLE");
this.setVisible(true);
//this.setLocation(300,300);
Helper.setPosition(this);
ALTER TABLE
package com.db;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import java.sql.*;
import java.sql.Connection;
import javax.swing.table.DefaultTableModel;
import javax.swing.tree.*;
import java.sql.PreparedStatement;
cbo=new DataComboBox();
VIPIN KUMAR 160 1670370140
cbo.setData(cn," Show Tables ",true);
cbo.setSelectedItem(this.tablename);
table=new DataTable();
p2.setBorder(BorderFactory.createTitledBorder("Result
Set"));
p2.add(new JScrollPane(table));
this.getContentPane().add(p2,BorderLayout.CENTER);
cmd1.addActionListener(new ActionListener()
});
cmd2=new JButton("ADD");
cmd3.addActionListener(new ActionListener()
int row=table.getSelectedRow();
table.getDataTableModel().removeRow(row);
});
cmd4=new JButton("Discard");
cmd4.addActionListener(new ActionListener()
VIPIN KUMAR 162 1670370140
{
AlterTable.this.setVisible(false);
});
cmd2.addActionListener(new ActionListener()
String str="";
try
int i=0;
for(i=previousRowCount;i<table.getRowCount()-1;i++)
String
a2=table.getValueAt(i,1).toString();
//String
a3=table.getValueAt(i,2).toString();
String
a4=table.getValueAt(i,3).toString();
String
a1=table.getValueAt(i,0).toString();
String
a2=table.getValueAt(i,1).toString();
//String
a3=table.getValueAt(i,2).toString();
String
a4=table.getValueAt(i,3).toString();
JOptionPane.showMessageDialog(AlterTable.this,sql);
PreparedStatement
ps=cn.prepareStatement(sql);
VIPIN KUMAR 164 1670370140
int a=ps.executeUpdate();
catch(Exception e)
JOptionPane.showMessageDialog(AlterTable.this,e.getMess
age());
});
txt1=new JTextField(10);
txt1.setText(this.tablename);
this.initLabel();
this.initCmdButton();
VIPIN KUMAR 165 1670370140
this.initTextBox();
this.initComboBox();
this.initTable();
p1.setBorder(BorderFactory.createTitledBorder(""));
p1.add(l1);
p1.add(txt1);
p1.add(l2);
p1.add(cbo);
this.getContentPane().add(p1,BorderLayout.NORTH);
//p3.setBorder(BorderFactory.createTitledBorder
(""));
p3.add(cmd1);
p3.add(cmd2);
p3.add(cmd3);
//p4.setBorder(BorderFactory.createTitledBorder
(""));
p4.add(cmd4);
p0.add(p3);
p0.add(p4);
this.getContentPane().add(p0,BorderLayout.SOUTH);
cn=con;
this.tablename=str;
this.initComponent();
this.setTitle("ALTER TABLE");
this.setVisible(true);
//this.setLocation(300,300);
this.setSize(300,300);
Helper.setPosition(this);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
structure();
try
table.clearTable();
PreparedStatement
ps=cn.prepareStatement("DESC "+tablename);
ResultSet rs=ps.executeQuery();
while(rs.next())
for(int
i=1;i<=rs.getMetaData().getColumnCount();i++)
v2.add(rs.getString(i));
v1.add(v2);
v3.add(rs.getMetaData().getColumnLabel(i));
table.getDataTableModel().setDataVector(v1,v3);
table.updateUI();
previousRowCount=table.getRowCount();
catch(Exception e)
JOptionPane.showMessageDialog(null,e.toString());
CREATE DATABASE
VIPIN KUMAR 169 1670370140
package com.db;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import java.sql.*;
import java.sql.Connection;
try
JOptionPane.showMessageDialog(null,str1);
PreparedStatement ps=cn.prepareStatement(str1);
int a=ps.executeUpdate();
}
VIPIN KUMAR 170 1670370140
catch(Exception e)
JOptionPane.showMessageDialog(null,e.getMessage());
txt1=new JTextField(10);
cmd1=new JButton("O.K");
cmd1.addActionListener(new ActionListener()
initQuery();
});
cmd2.addActionListener(new ActionListener()
CreateDatabase.this.setVisible(false);
});
p1.setBorder(BorderFactory.createTitledBorder(""));
p1.add(l1);
this.getContentPane().add(p1,BorderLayout.NORTH);
p2.setBorder(BorderFactory.createTitledBorder(""));
p2.add(l2);
p2.add(txt1);
p2.add(cmd2);
this.getContentPane().add(p2,BorderLayout.SOUTH);
cn=con;
this.initComponent();
this.setTitle("Create Database");
this.setVisible(true);
this.setLocation(300,300);
Helper.setPosition(this);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
CREATE USER
package com.db;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
import javax.swing.table.DefaultTableModel;
import java.util.Vector;
import java.sql.Connection;
import java.sql.PreparedStatement;
cbo=new DataComboBox();
try
ResultSet rs=cn.prepareStatement("Show
databases").executeQuery();
VIPIN KUMAR 174 1670370140
while(rs.next())
cbo.addItem(rs.getString(1));
catch(Exception e){}
this.initComboBox();
this.cmdButton();
l3=new JLabel("Password");
txt1=new JTextField(10);
jpf=new JPasswordField(10);
p1.setBorder(BorderFactory.createTitledBorder(""));
VIPIN KUMAR 175 1670370140
p1.add(l1);
p1.add(cbo);
p1.add(l2);
p1.add(txt1);
p1.add(l3);
p1.add(jpf);
p1.setBorder(BorderFactory.createTitledBorder(""));
p2.add(cmd1);
this.getContentPane().add(p1,BorderLayout.NORTH);
this.getContentPane().add(p2,BorderLayout.SOUTH);
cmd1.addActionListener(new ActionListener()
{
VIPIN KUMAR 176 1670370140
public void actionPerformed(ActionEvent
ae)
try
PreparedStatement
ps=cn.prepareStatement(sql);
int a=ps.executeUpdate();
JOptionPane.showMessageDialog(null,sql);
JOptionPane.showMessageDialog(null,"
USER SUCCESSFULLY CREATED");
catch(Exception e)
JOptionPane.showMessageDialog(null,e.getMessage());
})
cn=con;
this.initComponent();
this.setTitle("Create User");
this.setSize(200,200);
this.setVisible(true);
Helper.setPosition(this);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
package com.db;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
import java.sql.*;
import javax.swing.table.DefaultTableModel;
import java.util.Vector;
import java.sql.Connection;
import java.sql.PreparedStatement;
cmd1.addActionListener(new ActionListener()
try
PreparedStatement
ps=cn.prepareStatement(sql);
ps.executeUpdate();
JOptionPane.showMessageDialog(null,sql);
JOptionPane.showMessageDialog(null,"
VIEW SUCCESSFULLY CREATED ");
catch(Exception e)
});
cmd2.addActionListener(new ActionListener()
CreateView.this.setVisible(false);
});
txt1=new JTextField(10);
VIPIN KUMAR 181 1670370140
this.cmdButton();
p1.setBorder(BorderFactory.createTitledBorder(""));
p1.add(l1);
p1.add(txt1);
p1.setBorder(BorderFactory.createTitledBorder(""));
p2.add(cmd1);
p2.add(cmd2);
this.getContentPane().add(p1,BorderLayout.NORTH);
this.getContentPane().add(p2,BorderLayout.SOUTH);
cn=con;
this.initComponent();
this.setTitle("Create User");
this.setSize(200,200);
this.setVisible(true);
Helper.setPosition(this);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
Drop view
VIPIN KUMAR 183 1670370140
package com.db;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
import java.sql.*;
import javax.swing.table.DefaultTableModel;
import java.util.Vector;
import java.sql.Connection;
import java.sql.PreparedStatement;
cmd1.addActionListener(new ActionListener()
VIPIN KUMAR 184 1670370140
{
try
PreparedStatement
ps=cn.prepareStatement(sql);
ps.executeUpdate();
JOptionPane.showMessageDialog(null,sql);
JOptionPane.showMessageDialog(null,"
View Dropped Succesfully");
catch(Exception e)
JOptionPane.showMessageDialog(DropView.this,e.getMessag
e());
}
VIPIN KUMAR 185 1670370140
});
cmd2.addActionListener(new ActionListener()
DropView.this.setVisible(false);
});
txt1=new JTextField(10);
this.cmdButton();
p1.setBorder(BorderFactory.createTitledBorder(""));
p1.add(l1);
p1.add(txt1);
p1.setBorder(BorderFactory.createTitledBorder(""));
p2.add(cmd1);
p2.add(cmd2);
this.getContentPane().add(p1,BorderLayout.NORTH);
this.getContentPane().add(p2,BorderLayout.SOUTH);
cn=con;
this.tablename=str;
this.initComponent();
this.setTitle("DROP USER");
this.setSize(200,200);
Helper.setPosition(this);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
RENAME TABLE
package com.db;
import java.awt.*;
VIPIN KUMAR 188 1670370140
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import java.sql.*;
txt1=new JTextField(10);
cbo=new DataComboBox();
cbo.setData(cn,"Show Tables",true);
cmd1=new JButton("Rename");
cmd1.addActionListener(new ActionListener()
initQuery();
});
cmd2=new JButton("Cancel");
cmd2.addActionListener(new ActionListener()
clear();
VIPIN KUMAR 190 1670370140
}
});
try
PreparedStatement
ps=cn.prepareStatement(str1);
ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Successfully
Renamed");
catch(Exception e)
JOptionPane.showMessageDialog(null,e.getMessage());
VIPIN KUMAR 191 1670370140
}
txt1.setText("");
this.initLabel();
this.initCmdButton();
this.initTextBox();
this.initComboBox();
p1.setBorder(BorderFactory.createTitledBorder(""));
p1.add(l1);
p1.add(cbo);
p1.add(l2);
p1.add(txt1);
VIPIN KUMAR 192 1670370140
JPanel p2=new JPanel(new GridLayout(1,2,5,5));
p2.setBorder(BorderFactory.createTitledBorder(""));
p2.add(cmd1);
p2.add(cmd2);
this.getContentPane().add(p1,BorderLayout.NORTH);
this.getContentPane().add(p2,BorderLayout.SOUTH);
cn=con;
this.initComponent();
this.setTitle("Rename Table");
this.setVisible(true);
//this.setLocation(300,300);
this.setSize(300,300);
Helper.setPosition(this);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
package com.db;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
import java.sql.*;
import javax.swing.table.DefaultTableModel;
import java.sql.Connection;
import java.sql.PreparedStatement;
private JButton
cmd1,cmd2,cmd3,cmd4,cmd5,cmd6,cmd7,b1;
private JMenu
Table,Advanced,Edit,View,Administrator;
private JMenuItem
table1,table2,table3,table4,table5;
table1.addActionListener(new ActionListener()
public void
actionPerformed(ActionEvent ae)
String
name=tree1.getLastSelectedPathComponent().toString();
TreeNode
node=(TreeNode)tree1.getLastSelectedPathComponent();
if(!node.isLeaf())
JOptionPane.showMessageDialog(null,name);
});
table2.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
r.pack();
});
table3.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
c.pack();
});
table4.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
droptable();
setTree();
});
VIPIN KUMAR 198 1670370140
table5=new JMenuItem("Create using Another
Table");
table5.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
c.pack();
});
adv1.addActionListener(new ActionListener()
public void
actionPerformed(ActionEvent ae)
String
name=tree1.getLastSelectedPathComponent().toString().tr
im();
TreeNode
node=(TreeNode)tree1.getLastSelectedPathComponent();
if(!node.isLeaf())
table.clearTable();
Vector v1=new
Vector();
PreparedStatement
ps=cn.prepareStatement("DESC "+name);
ResultSet
rs=ps.executeQuery();
while(rs.next())
Vector v2=new
Vector();
for(int
i=1;i<=rs.getMetaData().getColumnCount();i++)
v1.add(v2);
Vector v3=new
Vector();
for(int
i=1;i<=rs.getMetaData().getColumnCount();i++)
v3.add(rs.getMetaData().getColumnLabel(i));
table.getDataTableModel().setDataVector(v1,v3);
table.updateUI();
catch(Exception e)
});
adv2=new JMenuItem("Sorting");
adv2.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
String
name=tree1.getLastSelectedPathComponent().toString();
TreeNode
node=(TreeNode)tree1.getLastSelectedPathComponent();
if(node.isLeaf())
table.setData(cn," SELECT *
FROM "+node.getParent().toString()+" ORDER BY "+name);
});
adv3=new JMenuItem("Print");
adv3.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
if(table.getRowCount()>0)
Helper.printTable(table);
});
edit1.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
initInsertValues();
});
edit2.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
try
TreeNode
node=(TreeNode)tree1.getLastSelectedPathComponent();
JOptionPane.showMessageDialog(null,sql);
PreparedStatement
ps=cn.prepareStatement(sql);
int a=ps.executeUpdate();
if(a>0)
table.setData(cn,"Select *
from "+node.getParent().toString());
catch(Exception e){}
});
view1.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
String
name=tree1.getLastSelectedPathComponent().toString().tr
im();
CreateView e=new
CreateView(cn,name);
e.pack();
});
view2.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
String
name=tree1.getLastSelectedPathComponent().toString().tr
im();
d.pack();
});
admin1.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
c.pack();
});
public void
actionPerformed(ActionEvent ae)
String
name=tree1.getLastSelectedPathComponent().toString().tr
im();
e.pack();
});
Table=new JMenu("Table");
Advanced=new JMenu("Advanced");
Edit=new JMenu("Edit");
View=new JMenu("View");
Administrator=new
JMenu("Administrator");
Table.add(table2);
Table.add(table3);
Table.add(table4);
Table.add(table5);
Advanced.add(adv1);
Advanced.add(adv2);
Advanced.add(adv3);
Edit.add(edit1);
Edit.add(edit2);
View.add(view1);
View.add(view2);
Administrator.add(admin1);
Administrator.add(admin2);
bar=new JMenuBar();
bar.add(Table);
bar.add(Advanced);
bar.add(Edit);
bar.add(View);
bar.add(Administrator);
VIPIN KUMAR 209 1670370140
this.setJMenuBar(bar);
Pmenu.add(menuItem);
menuItem.addActionListener(new ActionListener()
c.pack();
setTree();
});
Pmenu.add(menuItem);
menuItem.addActionListener(new ActionListener()
String
name=tree1.getLastSelectedPathComponent().toString();
Helper.insertRow(cn,table,name);
});
Pmenu.add(menuItem);
menuItem.addActionListener(new ActionListener()
String
name=tree1.getLastSelectedPathComponent().toString().tr
im();
r.pack();
});
Pmenu.add(menuItem);
menuItem.addActionListener(new ActionListener()
r.pack();
});
Pmenu.add(menuItem);
menuItem.addActionListener(new ActionListener()
droptable();
setTree();
});
VIPIN KUMAR 212 1670370140
menuItem = new JMenuItem("Create New Schema");
Pmenu.add(menuItem);
menuItem.addActionListener(new ActionListener()
c.pack();
setTree();
});
Pmenu.add(menuItem);
menuItem.addActionListener(new ActionListener()
txtr1.setText("");
setTree();
});
VIPIN KUMAR 213 1670370140
}
l1=new JLabel(new
ImageIcon("images/mysql1.jpg"));
tlb=new JToolBar();
this.initLabel();
txtr1=new JTextArea();
cmd1=new JButton(new
ImageIcon("images/goback.jpg"));
cmd1.addActionListener(new ActionListener()
QueryBrowserForm q=new
QueryBrowserForm();
q.pack();
});
cmd3=new JButton(new
ImageIcon("images/refresh1.jpg"));
cmd3.addActionListener(new ActionListener()
txtr1.setText("");
setTree();
});
cmd4=new JButton(new
ImageIcon("images/execute.jpg"));
cmd4.addActionListener(new ActionListener()
try
if(txtr1.getText().length()>0)
String
sql=txtr1.getText().toUpperCase();
if(sql.startsWith("SELECT") ||
sql.startsWith("DESC") || sql.startsWith("SHOW"))
table.setData(cn,sql);
else
PreparedStatement
ps=cn.prepareStatement(sql);
int a=ps.executeUpdate();
catch(Exception e)
});
cmd5=new JButton(new
ImageIcon("images/Stop.jpg"));
cmd5=new JButton(new
ImageIcon("images/refresh1.jpg"));
cmd5.addActionListener(new ActionListener()
MySqlQueryBrowser.this.setVisible(false);
});
tlb.add(cmd1);
VIPIN KUMAR 217 1670370140
tlb.add(cmd3);
tlb.add(txtr1);
tlb.add(cmd4);
tlb.add(cmd5);
tlb.add(l1);
this.getContentPane().add(tlb,BorderLayout.NORTH);
try
root1=new
DefaultMutableTreeNode("---------------"+cn.getCatalog(
)+"--------------");
this.setTree();
root2=new
DefaultMutableTreeNode("History");
catch(Exception e){}
tree1.addMouseListener(new MouseAdapter()
if(me.isPopupTrigger())
Pmenu.show(me.getComponent(),me.getX(),me.getY());
});
tree2=new JTree(root2);
tab1=new JTabbedPane();
tab1.add("Schemata",new JScrollPane(tree1));
tab1.add("History",new JScrollPane(tree2));
p1.add(tab1);
table=new DataTable();
p1.setBorder(BorderFactory.createTitledBorder("Result
Set"));
p1.add(new JScrollPane(table));
this.getContentPane().add(p1,BorderLayout.CENTER);
try
String
name=tree1.getLastSelectedPathComponent().toString();
if(!node.isLeaf())
if(table.getRowCount()==0)
JOptionPane.showMessageDialog(null,name);
PreparedStatement ps=
cn.prepareStatement(sql);
int a=ps.executeUpdate();
catch(Exception e)
JOptionPane.showMessageDialog(null,e.getMessage());
{
VIPIN KUMAR 221 1670370140
this.MenuContainer();
this.initTree();
PopUpMenu();
this.initTable();
cmd6.addActionListener(new ActionListener()
initInsertValues();
});
cmd7.addActionListener(new ActionListener()
try
TreeNode
node=(TreeNode)tree1.getLastSelectedPathComponent();
JOptionPane.showMessageDialog(null,sql);
PreparedStatement
ps=cn.prepareStatement(sql);
int a=ps.executeUpdate();
if(a>0)
table.setData(cn,"Select *
from "+node.getParent().toString());
catch(Exception e){}
});
VIPIN KUMAR 223 1670370140
JPanel p2=new JPanel(new GridLayout(1,2,5,5));
p2.setBorder(BorderFactory.createTitledBorder(""));
p2.add(cmd6);
p2.add(cmd7);
this.getContentPane().add(p2,BorderLayout.SOUTH);
cn=con;
this.initToolbar();
this.initcomponents();
this.setVisible(true);
this.setSize(Toolkit.getDefaultToolkit().getScreenSize(
));
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
root1.removeAllChildren();
java.util.Iterator
itr=Helper.getTables(cn);
while(itr.hasNext())
String n=(String)itr.next();
DefaultMutableTreeNode temp=new
DefaultMutableTreeNode(n);
setFields(temp,n);
root1.add(temp);
tree1.updateUI();
try
String
name=tree1.getLastSelectedPathComponent().toString();
int count=table.getColumnCount();
VIPIN KUMAR 225 1670370140
String str="INSERT INTO "+name+ " VALUES
(";
for(int i=0;i<table.getColumnCount()-1;i+
+)
str+="?,";
v.addElement(table.getValueAt(table.getSelectedRow(),i)
.toString());
str+="?)";
v.addElement(table.getValueAt(table.getSelectedRow(),co
unt-1).toString());
JOptionPane.showMessageDialog(null,str);
PreparedStatement
ps=cn.prepareStatement(str);
for(int k=1;k<=count;k++)
ps.setString(k,(String)v.get(k-1));
int a=ps.executeUpdate();
VIPIN KUMAR 226 1670370140
}
catch(Exception e)
JOptionPane.showMessageDialog(null,e.getMessage());
try{
ResultSet rs=ps.executeQuery();
while(rs.next())
parent.add(new
DefaultMutableTreeNode(rs.getString(1)));
catch(Exception e){}
}}
package com.db;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.Connection;
cmd2=new JButton("O.K");
this.getRootPane().setDefaultButton(cmd2);
VIPIN KUMAR 228 1670370140
cmd2.addActionListener(new ActionListener()
try
p.setIP(txt1.getText());
p.setPort(txt2.getText());
p.setSid(txt3.getText());
p.setUser(txt4.getText());
p.setPassword(jpf.getText());
Connection
cn=p.getOracleConnection();
if(!cn.isClosed())
OracleQuerybrowserForm
f=new OracleQuerybrowserForm(cn);
OracleBrowserForm.this.setVisible(false);
JOptionPane.showMessageDialog(null,"Login
Failed...Retry\n\n"+p.ERROR);
catch(Exception e)
JOptionPane.showMessageDialog(null,"Login
Failed...Retry\n\n"+p.ERROR);
});
cmd3=new JButton("Clear");
cmd3.addActionListener(new ActionListener()
});
cmd4=new JButton("Cancel");
cmd4.addActionListener(new ActionListener()
OracleBrowserForm.this.setVisible(false);
});
l1=new JLabel(new
ImageIcon("images/Oracle.jpg"));
l4=new JLabel("Port");
l6=new JLabel("Username");
l7=new JLabel("Password");
txt1=new JTextField(10);
txt1.setText("127.0.0.1");
txt2=new JTextField(2);
txt2.setText("1521");
txt3=new JTextField(10);
txt3.setText("xe");
txt4=new JTextField(10);
txt1.setText("");
VIPIN KUMAR 232 1670370140
txt2.setText("");
txt3.setText("");
txt4.setText("");
jpf.setText("");
this.initLabel();
this.textfield();
this.cmdbutton();
p1.setBorder(BorderFactory.createTitledBorder(""));
p1.add(l1);
p2.add(l3);
p2.add(txt1);
p2.add(l4);
p2.add(txt2);
p2.add(l5);
p2.add(txt3);
p2.add(l6);
p2.add(txt4);
p2.add(l7);
jpf=new JPasswordField(10);
p2.add(jpf);
p3.setBorder(BorderFactory.createTitledBorder(""));
p3.add(cmd1);
p3.add(cmd3);
p3.add(cmd4);
this.getContentPane().add(p1,BorderLayout.NORTH);
this.getContentPane().add(p2,BorderLayout.CENTER);
this.getContentPane().add(p3,BorderLayout.SOUTH);
public OracleBrowserForm()
this.initComponents();
this.setSize(450,450);
this.setLocation(300,300);
this.setVisible(true);
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
package com.db;
import java.sql.Connection;
import java.sql.DriverManager;
this.url="jdbc:oracle:thin:@"+this.ip+":"+this.port+":"
+this.sid;
public Oracle()
VIPIN KUMAR 237 1670370140
{
this.ip="127.0.0.1";
this.port="1521";
this.sid="xe";
this.user="system";
this.password="";
this.makeUrl();
this.ip=ip;
this.port="1521";
this.sid="xe";
this.user="sytem";
this.password="";
this.makeUrl();
this.ip=ip;
this.port=port;
this.sid="xe";
this.user="system";
VIPIN KUMAR 238 1670370140
this.password="";
this.makeUrl();
this.ip=ip;
this.port=port;
this.sid="xe";
this.user="Oracle";
this.password="";
this.makeUrl();
this.ip=ip;
this.port=port;
this.sid="xe";
this.user=user;
this.password="";
this.makeUrl();
this.ip=ip;
this.port=port;
this.sid=sid;
this.user=user;
this.password=password;
this.makeUrl();
Connection cn=null;
try
Class.forName("oracle.jdbc.OracleDriver");
cn=DriverManager.getConnection(this.url,this.user,this.
password);
catch(Exception e)
this.ERROR=e.getMessage();
VIPIN KUMAR 240 1670370140
}
return cn;
Connection cn=null;
try
Class.forName
("oracle.jdbc.driver.OracleDriver");
cn=DriverManager.getConnection(this.url,this.user,this.
password);
if(!cn.isClosed())
cn.setAutoCommit(commitMode);
catch(Exception e)
this.ERROR=e.getMessage();
this.ip=ip;
this.makeUrl();
this.port=port;
this.makeUrl();
this.makeUrl();
this.user=user;
this.makeUrl();
}
VIPIN KUMAR 242 1670370140
public void setPassword(String password)
this.password=password;
return this.ip;
return this.port;
return this.sid;
return this.user;
return this.password;
VIPIN KUMAR 243 1670370140
}
return this.url;
this.sid=s;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import java.sql.*;
txt1=new JTextField(10);
txt1.setText(this.tablename);
txt2=new JTextField(10);
cmd1=new JButton("Rename");
cmd1.addActionListener(new ActionListener()
initQuery();
});
cmd2=new JButton("Cancel");
cmd2.addActionListener(new ActionListener()
clear();
});
{
VIPIN KUMAR 246 1670370140
try
PreparedStatement
ps=cn.prepareStatement(str1);
ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Successfully
Renamed");
catch(Exception e)
JOptionPane.showMessageDialog(null,e.getMessage());
txt1.setText("");
VIPIN KUMAR 247 1670370140
txt2.setText("");
this.initLabel();
this.initCmdButton();
this.initTextBox();
//this.initComboBox();
p1.setBorder(BorderFactory.createTitledBorder(""));
p1.add(l1);
p1.add(txt1);
p1.add(l2);
p1.add(txt2);
p2.setBorder(BorderFactory.createTitledBorder(""));
p2.add(cmd1);
p2.add(cmd2);
this.getContentPane().add(p2,BorderLayout.SOUTH);
cn=con;
this.tablename=str;
this.initComponent();
this.setTitle("Rename Table");
this.setVisible(true);
this.setSize(300,300);
Helper.setPosition(this);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
package com.db;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
import java.sql.*;
import javax.swing.table.DefaultTableModel;
import java.util.Vector;
import java.sql.Connection;
import java.sql.PreparedStatement;
{
VIPIN KUMAR 250 1670370140
protected Connection cn;
private JMenu
Table,Advanced,Edit,View,Administrator;
private JMenuItem
table1,table2,table3,table4,table5;
Pmenu.add(menuItem);
menuItem.addActionListener(new ActionListener()
c.pack();
setTree();
});
Pmenu.add(menuItem);
menuItem.addActionListener(new ActionListener()
String
name=tree1.getLastSelectedPathComponent().toString();
VIPIN KUMAR 252 1670370140
Helper.insertRow(cn,table,name);
});
Pmenu.add(menuItem);
menuItem.addActionListener(new ActionListener()
String
name=tree1.getLastSelectedPathComponent().toString().tr
im();
RenameOracleTable r=new
RenameOracleTable(cn,name);
r.pack();
});
Pmenu.add(menuItem);
menuItem.addActionListener(new ActionListener()
{
VIPIN KUMAR 253 1670370140
public void actionPerformed(ActionEvent e)
droptable();
setTree();
});
Pmenu.add(menuItem);
menuItem.addActionListener(new ActionListener()
setTree();
txtr1.setText("");
});
public void
actionPerformed(ActionEvent ae)
String
name=tree1.getLastSelectedPathComponent().toString();
TreeNode
node=(TreeNode)tree1.getLastSelectedPathComponent();
if(!node.isLeaf())
JOptionPane.showMessageDialog(null,name);
table.setData(cn," SELECT *
FROM "+name);
});
public void
actionPerformed(ActionEvent ae)
RenameOracleTable r=new
RenameOracleTable(cn);
r.pack();
});
table3.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
c.pack();
});
table4.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
droptable();
setTree();
});
table5.addActionListener(new
ActionListener()
CreateTable c=new
CreateTable(cn);
c.pack();
});
adv1=new JMenuItem("Print");
adv1.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
if(table.getRowCount()>0)
Helper.printTable(table);
});
edit1.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
initInsertValues();
});
edit2.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
try
TreeNode
node=(TreeNode)tree1.getLastSelectedPathComponent();
JOptionPane.showMessageDialog(null,sql);
PreparedStatement
ps=cn.prepareStatement(sql);
int a=ps.executeUpdate();
if(a>0)
table.setData(cn,"Select *
from "+node.getParent().toString());
catch(Exception e){}
});
view1.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
String
name=tree1.getLastSelectedPathComponent().toString().tr
im();
CreateView e=new
CreateView(cn,name);
e.pack();
});
view2.addActionListener(new
ActionListener()
String
name=tree1.getLastSelectedPathComponent().toString().tr
im();
d.pack();
});
admin1.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
c.pack();
});
admin2.addActionListener(new
ActionListener()
public void
actionPerformed(ActionEvent ae)
String
name=tree1.getLastSelectedPathComponent().toString().tr
im();
e.pack();
});
Table=new JMenu("Table");
Advanced=new JMenu("Advanced");
Edit=new JMenu("Edit");
View=new JMenu("View");
Administrator=new
JMenu("Administrator");
Table.add(table2);
Table.add(table3);
Table.add(table4);
Table.add(table5);
Advanced.add(adv1);
Edit.add(edit1);
Edit.add(edit2);
View.add(view1);
View.add(view2);
Administrator.add(admin1);
Administrator.add(admin2);
bar=new JMenuBar();
bar.add(Table);
bar.add(Advanced);
bar.add(Edit);
bar.add(View);
bar.add(Administrator);
this.setJMenuBar(bar);
VIPIN KUMAR 264 1670370140
}
try
root1=new
DefaultMutableTreeNode("---------"+cn.getMetaData()
+"---------");
this.setTree();
root2=new DefaultMutableTreeNode("History");
catch(Exception e){}
tree1=new JTree(root1);
tree1.addMouseListener(new MouseAdapter()
if(me.isPopupTrigger())
Pmenu.show(me.getComponent(),me.getX(),me.getY());
VIPIN KUMAR 265 1670370140
}
});
tree2=new JTree(root2);
tab1=new JTabbedPane();
tab1.add("Schemata",new JScrollPane(tree1));
tab1.add("History",new JScrollPane(tree2));
p1.add(tab1);
this.getContentPane().add(p1,BorderLayout.EAST);
tlb=new JToolBar();
txtr1=new JTextArea();
VIPIN KUMAR 266 1670370140
cmd1=new JButton(new
ImageIcon("images/goback.jpg"));
cmd1.addActionListener(new ActionListener()
OracleBrowserForm q=new
OracleBrowserForm();
q.pack();
OracleQuerybrowserForm.this.setVisible(false);
});
cmd2=new JButton(new
ImageIcon("images/next.jpg"));
cmd3=new JButton(new
ImageIcon("images/refresh1.jpg"));
cmd4=new JButton(new
ImageIcon("images/execute.jpg"));
cmd5=new JButton(new
ImageIcon("images/Stop.jpg"));
cmd4.addActionListener(new ActionListener()
try
if(txtr1.getText().length()>0)
String
sql=txtr1.getText().toUpperCase();
if(sql.startsWith("SELECT") ||
sql.startsWith("DESC") || sql.startsWith("SHOW"))
table.setData(cn,sql);
else
PreparedStatement
ps=cn.prepareStatement(sql);
int a=ps.executeUpdate();
catch(Exception e)
});
tlb.add(cmd1);
tlb.add(cmd2);
tlb.add(cmd3);
tlb.add(txtr1);
tlb.add(cmd4);
tlb.add(cmd5);
this.getContentPane().add(tlb,BorderLayout.NORTH);
table=new DataTable();
p1.setBorder(BorderFactory.createTitledBorder("Result
Set"));
this.getContentPane().add(p1,BorderLayout.CENTER);
this.MenuContainer();
this.initTree();
PopUpMenu();
this.initTable();
cmd6.addActionListener(new ActionListener()
initInsertValues();
});
cmd7.addActionListener(new ActionListener()
try
TreeNode
node=(TreeNode)tree1.getLastSelectedPathComponent();
JOptionPane.showMessageDialog(null,sql);
PreparedStatement
ps=cn.prepareStatement(sql);
int a=ps.executeUpdate();
if(a>0)
catch(Exception e){}
});
p2.setBorder(BorderFactory.createTitledBorder(""));
p2.add(cmd6);
p2.add(cmd7);
this.getContentPane().add(p2,BorderLayout.SOUTH);
try
TreeNode
node=(TreeNode)tree1.getLastSelectedPathComponent();
if(!node.isLeaf())
if(table.getRowCount()==0)
JOptionPane.showMessageDialog(null,name);
PreparedStatement ps=
cn.prepareStatement(sql);
int a=ps.executeUpdate();
catch(Exception e)
JOptionPane.showMessageDialog(null,e.getMessage());
cn=con;
this.initToolbar();
this.initcomponents();
this.setTitle("Oracle Query
Browser.....");
this.setVisible(true);
this.setSize(Toolkit.getDefaultToolkit().getScreenSize(
));
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
try
String
name=tree1.getLastSelectedPathComponent().toString();
int count=table.getColumnCount();
for(int i=0;i<table.getColumnCount()-1;i+
+)
str+="?,";
v.addElement(table.getValueAt(table.getSelectedRow(),i)
.toString());
str+="?)";
v.addElement(table.getValueAt(table.getSelectedRow(),co
unt-1).toString());
JOptionPane.showMessageDialog(null,str);
PreparedStatement
ps=cn.prepareStatement(str);
for(int k=1;k<=count;k++)
{
VIPIN KUMAR 275 1670370140
ps.setString(k,(String)v.get(k-1));
int a=ps.executeUpdate();
catch(Exception e)
JOptionPane.showMessageDialog(null,e.getMessage());
root1.removeAllChildren();
java.util.Iterator
itr=Helper.getOracleTables(cn);
while(itr.hasNext())
String n=(String)itr.next();
DefaultMutableTreeNode temp=new
DefaultMutableTreeNode(n);
setFields(temp,n);
root1.add(temp);
tree1.updateUI();
try
PreparedStatement
ps=cn.prepareStatement("SELECT * FROM TAB
"+tableName);
ResultSet rs=ps.executeQuery();
while(rs.next())
parent.add(new
DefaultMutableTreeNode(rs.getString(1)));
catch(Exception e){}
} }
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.sql.Connection;
import java.sql.DriverManager;
cmd1=new JButton("Browse");
cmd2=new JButton("Proceed");
this.getRootPane().setDefaultButton(cmd2);
cmd2.addActionListener(new ActionListener()
VIPIN KUMAR 279 1670370140
{
try
MsAcessQueryBrowserForm
f=new MsAcessQueryBrowserForm(cn);
MsAcessLoginForm.this.setVisible(false);
catch(Exception e)
JOptionPane.showMessageDialog(null,"Login
Failed...Retry\n\n");
cmd1.setEnabled(false);
cmd2.setEnabled(false);
cmd3=new JButton("Cancel");
cmd3.addActionListener(new ActionListener()
MsAcessLoginForm.this.setVisible(false);
});
cmd1.addActionListener(new ActionListener()
try
JFileChooser ch=new
JFileChooser();
VIPIN KUMAR 281 1670370140
ch.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
ch.showOpenDialog(null);
File
file=ch.getSelectedFile();
txt1.setText(file.getAbsolutePath());
path=file.getAbsolutePath()+"\\"+txt2.getText()+".mdb";
if(!temp.exists())
JOptionPane.showMessageDialog(null,path);
FileInputStream
fis=new FileInputStream("lib/Temp.mdb");
FileOutputStream
fos=new FileOutputStream(path);
for(int
i=fis.read();i!=-1;i=fis.read())
fos.write(i);
VIPIN KUMAR 282 1670370140
}
fis.close();
fos.close();
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
cn=DriverManager.getConnection("jdbc:odbc:Driver={Micro
soft Access Driver (*.mdb)};DBQ="+path);
catch(Exception e)
JOptionPane.showMessageDialog(null,e.getMessage());
txt1=new JTextField(10);
txt1.setEditable(false);
txt2=new JTextField(10);
txt2.addKeyListener(new KeyAdapter()
if(txt2.getText().length()>0)
cmd1.setEnabled(true);
cmd2.setEnabled(true);
}
VIPIN KUMAR 284 1670370140
else
cmd1.setEnabled(false);
cmd1.setEnabled(false);
});
this.initLabel();
this.initTextField();
this.initCmdbutton();
p1.setBorder(BorderFactory.createTitledBorder(""));
p1.add(l1);
p2.setBorder(BorderFactory.createTitledBorder(""));
p2.add(txt1);
p2.add(cmd1);
p3.setBorder(BorderFactory.createTitledBorder(""));
p3.add(l3);
p3.add(txt2);
p3.add(cmd2);
p3.add(cmd3);
this.getContentPane().add(p1,BorderLayout.NORTH);
this.getContentPane().add(p2,BorderLayout.CENTER);
this.getContentPane().add(p3,BorderLayout.SOUTH);
public MsAcessLoginForm()
this.initComponent();
this.setVisible(true);
this.setSize(350,350);
this.setLocation(300,300);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
package com.db;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.util.Vector;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.*;
l1=new JLabel(new
ImageIcon("images/msacess.jpg"));
try
root1=new
DefaultMutableTreeNode("------------"+cn.getCatalog()
+"--------------");
java.util.Iterator
itr=Helper.getTables(cn);
while(itr.hasNext())
String n=(String)itr.next();
root1.add(new
DefaultMutableTreeNode(n));
root2=new
DefaultMutableTreeNode("History");
catch(Exception e){}
tree2=new JTree(root2);
tab1=new JTabbedPane();
tab1.add("Schemata",new JScrollPane(tree1));
tab1.add("History",new JScrollPane(tree2));
p1.add(tab1);
this.getContentPane().add(p1,BorderLayout.EAST);
this.initTree();
this.initTable();
tlb=new JToolBar();
this.initLabel();
txtr1=new JTextArea();
cmd1=new JButton(new
ImageIcon("images/goback.jpg"));
cmd1.addActionListener(new ActionListener()
MsAcessLoginForm q=new
MsAcessLoginForm();
q.pack();
MsAcessQueryBrowserForm.this.setVisible(false);
});
cmd2=new JButton(new
ImageIcon("images/refresh1.jpg"));
cmd2.addActionListener(new ActionListener()
txtr1.setText("");
setTree();
});
cmd3=new JButton(new
ImageIcon("images/execute.jpg"));
cmd3.addActionListener(new ActionListener()
try
String
sql=txtr1.getText().toUpperCase();
if(sql.startsWith("SELECT") ||
sql.startsWith("DESC") || sql.startsWith("SHOW"))
table.setData(cn,sql);
JOptionPane.showMessageDialog(null,sql);
else
PreparedStatement
ps=cn.prepareStatement(sql);
int a=ps.executeUpdate();
JOptionPane.showMessageDialog(null,sql);
catch(Exception e)
});
cmd4=new JButton(new
ImageIcon("images/Stop.jpg"));
tlb.add(cmd1);
tlb.add(cmd2);
tlb.add(txtr1);
tlb.add(cmd3);
tlb.add(cmd4);
tlb.add(l1);
this.getContentPane().add(tlb,BorderLayout.NORTH);
table=new DataTable();
p1.setBorder(BorderFactory.createTitledBorder("Result
Set"));
p1.add(new JScrollPane(table));
this.getContentPane().add(p1,BorderLayout.CENTER);
try
String
name=tree1.getLastSelectedPathComponent().toString();
TreeNode
node=(TreeNode)tree1.getLastSelectedPathComponent();
if(!node.isLeaf())
if(table.getRowCount()==0)
JOptionPane.showMessageDialog(null,name);
PreparedStatement ps=
cn.prepareStatement(sql);
int a=ps.executeUpdate();
catch(Exception e)
JOptionPane.showMessageDialog(null,e.getMessage());
root1.removeAllChildren();
java.util.Iterator
itr=Helper.getTables(cn);
while(itr.hasNext())
String n=(String)itr.next();
DefaultMutableTreeNode temp=new
DefaultMutableTreeNode(n);
VIPIN KUMAR 296 1670370140
setFields(temp,n);
root1.add(temp);
tree1.updateUI();
try
String
name=tree1.getLastSelectedPathComponent().toString();
TreeNode
node=(TreeNode)tree1.getLastSelectedPathComponent();
if(!node.isLeaf())
// int row=table.getSelectedRow();
PreparedStatement
ps=cn.prepareStatement(sql);
int a=ps.executeUpdate();
if(a>0)
else
JOptionPane.showMessageDialog(this,"Required Data
Missing");
catch(Exception e)
JOptionPane.showMessageDialog(this,e.getMessage());
try
String
name=tree1.getLastSelectedPathComponent().toString();
int count=table.getColumnCount();
for(int i=0;i<table.getColumnCount()-1;i+
+)
str+="?,";
v.addElement(table.getValueAt(table.getSelectedRow(),i)
.toString());
str+="?)";
v.addElement(table.getValueAt(table.getSelectedRow(),co
unt-1).toString());
JOptionPane.showMessageDialog(null,str);
PreparedStatement
ps=cn.prepareStatement(str);
for(int k=1;k<=count;k++)
{
VIPIN KUMAR 299 1670370140
ps.setString(k,(String)v.get(k-1));
int a=ps.executeUpdate();
catch(Exception e)
JOptionPane.showMessageDialog(null,e.getMessage());
cn=con;
this.initToolbar();
this.initcomponents();
this.setVisible(true);
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
try
PreparedStatement
ps=cn.prepareStatement("DESC "+tableName);
ResultSet rs=ps.executeQuery();
while(rs.next())
parent.add(new
DefaultMutableTreeNode(rs.getString(1)));
catch(Exception e){}
import com.mysql.jdbc.DatabaseMetaData;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Iterator;
import java.util.Vector;
import javax.swing.JOptionPane;
import java.sql.PreparedStatement;
import java.io.*;
return key+"";
if(txt.getText().length()>0)
return true;
else
return false;
try
Runtime r=Runtime.getRuntime();
Process p=r.exec(application);
catch(Exception e)
VIPIN KUMAR 303 1670370140
{
javax.swing.JOptionPane.showMessageDialog(null,e.getMes
sage());
Connection cn=null;
try
Class.forName("com.mysql.jdbc.Driver");
cn=DriverManager.getConnection("jdbc:mysql://127.0.0.1:
3306/mysql","root","anu");
catch(Exception e)
JOptionPane.showMessageDialog(null,
e.toString());
return cn;
}
VIPIN KUMAR 304 1670370140
public static Connection openConnection(String
database)
Connection cn=null;
try
Class.forName("com.mysql.jdbc.Driver");
cn=DriverManager.getConnection("jdbc:mysql://127.0.0.1:
3306/"+database,"root","anu");
catch(Exception e)
JOptionPane.showMessageDialog(null,
e.toString());
return cn;
Connection cn=null;
try
cn=DriverManager.getConnection("jdbc:mysql://127.0.0.1:
"+port+"/"+database,"root","anu");
catch(Exception e)
JOptionPane.showMessageDialog(null,
e.toString());
return cn;
try
if(!con.isClosed())
con.close();
catch(Exception e){}
Connection cn=null;
try
Class.forName("oracle.jdbc.driver.OracleDriver");
cn=DriverManager.getConnection("jdbc:oracle:thin:@local
host:1521:xe","system","anu");
cn.setAutoCommit(false);
catch(Exception e)
JOptionPane.showMessageDialog(null,
e.toString());
return cn;
Connection cn=null;
try
cn=DriverManager.getConnection("jdbc:odbc:Driver={Micro
soft Access Driver
(*.mdb)};DBQ="+file.getAbsolutePath());
catch(Exception e)
JOptionPane.showMessageDialog(null,
e.toString());
return cn;
String str="";
try
FileInputStream fis=new
FileInputStream(file);
for(int i=fis.read();i!=-
1;i=fis.read())
VIPIN KUMAR 308 1670370140
{
str+=(char)i;
fis.close();
catch(Exception e){}
return str;
boolean flag=false;
try
FileOutputStream fos=new
FileOutputStream(file);
fos.write(content.getBytes());
fos.close();
flag=file.exists();
catch(Exception e){}
return flag;
try
DatabaseMetaData
meta=(DatabaseMetaData) cn.getMetaData();
while (tables.next())
vector.addElement(tables.getString("TABLE_NAME"));
catch(Exception e){}
return vector.iterator();
try
PreparedStatement
ps=cn.prepareStatement("SELECT * FROM TAB");
ResultSet tables=ps.executeQuery();
while (tables.next())
vector.addElement(tables.getString(1));
tables.close();
catch(Exception e){}
return vector.iterator();
try
DatabaseMetaData
meta=(DatabaseMetaData) cn.getMetaData();
while (tables.next())
vector.addElement(tables.getString("TABLE_NAME"));
catch(Exception e){}
return vector.iterator();
java.awt.Dimension screenSize =
java.awt.Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocationRelativeTo(null);
java.awt.Dimension screenSize =
java.awt.Toolkit.getDefaultToolkit().getScreenSize();
frame.setSize(width/2, height/2);
frame.setLocationRelativeTo(null);
java.awt.Dimension screenSize =
java.awt.Toolkit.getDefaultToolkit().getScreenSize();
frame.setSize(width/2, height/2);
//frame.setLocationRelativeTo(null);
try
table.setData(cn,"Select * from
"+tableName);
table.getDataTableModel().addRow(v1);
table.updateUI();
catch(Exception e)
JOptionPane.showMessageDialog(null,e.toString());
try
table.print();
VIPIN KUMAR 314 1670370140
}
catch(Exception e)
JOptionPane.showMessageDialog(null,e.getMessage());
import java.sql.*;
import java.util.Vector;
import javax.swing.*;
public DataTable()
model=new
javax.swing.table.DefaultTableModel();
this.setModel(model);
model=new
javax.swing.table.DefaultTableModel();
for(int i=0;i<a.length;i++)
model.addColumn(a[i]);
this.setModel(model);
VIPIN KUMAR 316 1670370140
}
public
DataTable(javax.swing.table.DefaultTableModel m)
model=m;
this.setModel(model);
setData(cn,sql);
model=new
javax.swing.table.DefaultTableModel();
this.setModel(model);
this.setPreferredScrollableViewportSize(dimension);
this.updateUI();
this.repaint();
try
VIPIN KUMAR 317 1670370140
{
clearTable();
java.util.Vector v1=new
java.util.Vector();
PreparedStatement
ps=cn.prepareStatement(sql.toUpperCase().trim());
ResultSet rs=ps.executeQuery();
while(rs.next())
java.util.Vector v2=new
java.util.Vector();
for(int
i=1;i<=rs.getMetaData().getColumnCount();i++)
try
v2.add(rs.getString(i).toUpperCase());
catch(Exception e11)
v2.add("");
v1.add(v2);
java.util.Vector v3=new
java.util.Vector();
for(int
i=1;i<=rs.getMetaData().getColumnCount();i++)
v3.add(rs.getMetaData().getColumnLabel(i).toUpperCase()
);
model.setDataVector(v1,v3);
catch(SQLException sqle)
JOptionPane.showMessageDialog(null,
sqle.toString());
catch(Exception e)
try
clearTable();
while(rs.next())
java.util.Vector v2=new
java.util.Vector();
for(int
i=1;i<=rs.getMetaData().getColumnCount();i++)
v2.add(rs.getString(i).toUpperCase());
model.addRow(v2);
JOptionPane.showMessageDialog(null,
sqle.toString());
catch(Exception e)
JOptionPane.showMessageDialog(null,
e.toString());
if(this.getRowCount()>0 &&
row<this.getRowCount())
String a[]=new
String[this.getColumnCount()];
for(int i=0;i<a.length;i++)
a[i]=this.getValueAt(row,i).toString().toUpperCase().tr
im();
return a;
VIPIN KUMAR 321 1670370140
}
else
return null;
model.addRow(v);
if(this.getRowCount()>0)
model.removeRow(rowNumber);
for(int i=0;i<model.getColumnCount();i++)
{
VIPIN KUMAR 322 1670370140
a.add(model.getColumnName(i));
public javax.swing.table.DefaultTableModel
getDataTableModel()
return this.model;
package com.db;
import java.util.Vector;
import javax.swing.JOptionPane;
public DataComboBox()
value=new java.util.Vector<String>();
value=new java.util.Vector<String>();
setData(cn,sql);
return value.get(this.getSelectedIndex());
return this.getSelectedItem().toString();
try
value.removeAllElements();
this.removeAllItems();
java.sql.PreparedStatement
ps=cn.prepareStatement(sql);
java.sql.ResultSet rs=ps.executeQuery();
while(rs.next())
value.add(rs.getString(1));
this.addItem(rs.getString(2));
catch(Exception e){}
try
{
VIPIN KUMAR 325 1670370140
value.removeAllElements();
this.removeAllItems();
java.sql.PreparedStatement
ps=cn.prepareStatement(sql);
java.sql.ResultSet rs=ps.executeQuery();
while(rs.next())
String v=rs.getString(1);
value.add(v);
this.addItem(v);
catch(Exception e)
JOptionPane.showMessageDialog(null,e.toString());
this.addItem(frontValue);
value.add(backValue);
VIPIN KUMAR 326 1670370140
}
return this.value;
INPUT/OUTPUT SHOTS
FIRST WAY:
SECOND WAY
CLICK ON O.K
THIRD WAY
CLICK ON O.K
Open table
Table renamed
OPEN TABLE TO
INSERT RECORD
SECOND METHOD
VIPIN KUMAR 365 1670370140
INSERT RECORD
INSERT RECORD
INSERT RECORD
DELETE RECORD
FIRST METHOD:
VIPIN KUMAR 375 1670370140
DROP TABLE
SECOND METHOD
DROP TABLE
Altered table
VIPIN KUMAR 395 1670370140
Alter table through command
sorting
CREATE table
VIPIN KUMAR 423 1670370140
TABLE CREATION(IS DONE IN 3 WAYS)
FIRST WAY:
CLICK ON O.K
INSERT RECORD
INSERT RECORD
VIPIN KUMAR 464 1670370140
INSERT RECORD
VIPIN KUMAR 465 1670370140
OPEN TABLE TO SEE THE
INSERTED RECORD
VIPIN KUMAR 466 1670370140
OPEN TABLE TO SEE THE
INSERTED RECORD
RENAME TABLE
dROP TABLE
are creating that are intended to “demolish” the software that has been
finding an error.
A good test case is one that has a high probability of the finding an as-
the software. Testing can not show the absence of the defects, it can
Testing principles-
The pareto principle applies to testing ( this principle implies that 80% of the
all errors uncovered during testing likely be traceable to 20% of the of all
program modules)”.
large”.
TESTING-
Since the faults can occur during any phase in the software
development life cycle, different levels of testing are used in the testing
process. Each level of testing aims to test different aspects of the system.
Unit Testing
In unit testing the programs that make up the system were tested.
This level focuses first on the independent module to locate the error.
Integration testing
System Testing
type of discrepancy that still exist between the designed system and the
Each and every input and output program is executed separately and tested
for bugs. Whole of the system is executed and test data is parted and is
fixing into the system and the output reports are compared with the
life cycle. It is basically this stage that helps the programmer to know all the
possible flaws related with the working of his software and also helps to
check the functioning of the various checks that have been used in the
programs.
The complete project was tested in top down approach. For modular
testing of programs the program are executed one by one and there inputs
were taken out. The outputs thus formed were taken in the form of reports
of the project, which is given in the later part of the documentation. The
reports thus formed were found out to be correct when compared with the
installation, may explode into a much large problem later on. Testing is
being performed when users are asked to assist in identifying all possible
situations. That might arise as regards the factor that efforts were put to
for testing the system. The complete testing procedure was divided into
follows.
TESTING CRITERIA
operational bounds.
In this phase each and every condition with in a unit program were tested.
loops where tested for correctness, for foundry condition and for not getting
into infinite execution cycle. The data used was whatever necessary at the
instance. The path of each transaction from origin to destination was tested
Module Testing
This was carried out during the programming stage itself. Individual
programs were tested at the time of coding and necessary changes are
made there on to make sure that the tested at the time of coding and
necessary changes are made there on to make sure that the modules in the
the module. All aspects of the program viz. all choices available are properly
tested.
String Testing
After loading all individual program string was performed for each one of
another program. This step was completed after making necessary changes
wherever required.
it enables to derive set of the input conditions that will folly exercise all
Interface errors,
System Testing
After module and string testing, the systems were tested as whole
system testes were undertaken to check bundled modules for errors. The
on the actual data of the company followed this. During this phase the
verify and compare the result sets. The following criteria were to be used
Output Testing
No systems could be useful if it does not produced the required operation for
displayed by the system under consider was tested by asking the format
required by them.
User acceptance of a system is a key factor for the success of any system.
checks etc. are incorporated in this system, as the data has to be entered in
different cards.
The user is not familiar with new system the data entry screens are designed
Consistent
Compatible
Easy to use
a simulated environment.
Test Review
Test review is the process, which ensures that testing is carried out, as
planned test review decides whether or not the program is ready to ship out
with extreme values and under all relevant data screen against real this
Functional testing
For this reason this testing is sometimes refers to as Black box testing in
which the content of a black box is not known and function of black box is
involves only observation of output for certain input values, and there is no
organization is as follows:
system into operation while holding cost, risks and personal irritation to a
system break down, data files are damaged and tempers grow
are trying package is frequently not complete and people are trying
Conversion begins with a review of the project plan, the system test
approach.
Files are converted.
Parallel processing between the existing system and the new system is
initiated.
on a special from.
Assuming no problem, parallel procession is discontinued.
The reason behind the use of this approach is that the software has been
prepared and tested on a stand alone system. So, this software will be used
along with the manual system in the organization for sometimes to test its
functioning under real life conditions if there will be any problem with the
software then necessary changes will be made in the software and tem it will
MAINTENANCE
software has been delivered to the customer and put into operation.
All the four categories of the maintenance have been guarantied to the
Corrective Maintenance:
Perfective Maintenance:
system match with the benefits it will provide. The various kinds of costs
Operating Costs:- Include all the costs associated with the day to day
operation of the system.
that the firm is ready to do one time investment but doesn’t want high
reduced as no user training is needed and only paper and ribbon costs
SCOPE
The idea of the project is to develop software for caring out the following
activities like:
navigator facility
Oracle Navigator.
with the needs of users and customers in the future. Yet the software is
system.
sequences.
The candidate system developed is itself very flexible to modify itself with
the needs of users and customers in the future. Yet the software is capable
system.
sequences .
The idea of the project is to develop software for caring out the following
activities like:
Here I would like to mention the name of the books and URLs used for
system:
CODING PHASE
Complete Reference-Java
www.sunjava.com
www.w3schools.com