0% found this document useful (0 votes)
79 views13 pages

Chapter Three: Donna K. Keesling and James L. Spiller, in 2014 (7) Oracle 12 C

This chapter discusses the design of an Oracle-based banking database. It introduces Oracle 12C, which will manage all database functions. Primary keys and foreign keys are defined to link tables. The chapter also describes how to create procedures, functions, triggers, views and tables in Oracle 12C to store employee, customer, transaction and account information for processing banking operations. Queries, commits, and other SQL statements are also reviewed.

Uploaded by

eng mecko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views13 pages

Chapter Three: Donna K. Keesling and James L. Spiller, in 2014 (7) Oracle 12 C

This chapter discusses the design of an Oracle-based banking database. It introduces Oracle 12C, which will manage all database functions. Primary keys and foreign keys are defined to link tables. The chapter also describes how to create procedures, functions, triggers, views and tables in Oracle 12C to store employee, customer, transaction and account information for processing banking operations. Queries, commits, and other SQL statements are also reviewed.

Uploaded by

eng mecko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Chapter Three

Introduction
This chapter is present the design of Oracle Based Banking Database. The
system deals with tables and entries that concerns complicated multi-level of
data . The main core of the designed system is Oracle 12C that achieves all
functions of the proposed design. This chapter gives brief definitions of system
functions, mechanism and the communication between the system components.

Oracle 12C Database


Donna K. Keesling and James L. Spiller, in 2014 [7] Oracle 12 C
database was consist from Primary Key and Foreign Key
 Primary Key (PK) :-
In Oracle 12 C, a primary key is a single field or combination of fields
that uniquely defines a record. None of the fields that are part of the
primary key can contain a null value. A table can have only one primary
key.
 Foreign Key (FK) :-
In Oracle 12 C, a foreign key is a way to enforce referential integrity
within your Oracle database. A foreign key means that values in one table
must also appear in another table. The foreign key in the child table will
generally reference a primary key in the parent table.

3-1 Oracle 12C Query


Bob Bryla, in 2015 [9] query is can executed on Oracle 12 C such as
insert , delete , alter table , drop ,create and select.[1]

Oracle Select Query:- is used to fetch records from database.

Oracle Insert Query :-is used to insert record into table .

Oracle Update Query:-is used to update records of table .

Oracle Delete Query:- is used to delete records of table from database.


Oracle Drop Query:- is used to drop a table or view.

Oracle Create Query :- is used to create table , view , sequence, procedure and
function .

3-1 Oracle 12C Create Procedure


Joan Casteel , in 2015 [8] to help you build powerful database
applications, stored procedures provide several advantages including better
performance, higher productivity, ease of use, and increased scalability as
shown in figure(3-).

Figure (3-) Create Procedure

3-1-1 Performance :-

Stored procedures are compiled once and stored in executable form, so


procedure calls are quick and efficient. Executable code is automatically cached
and shared among users. This lowers memory requirements and invocation
overhead.

Additionally, stored procedures enable you to take advantage of the computing


resources of the server. For example, you can move computation-bound
procedures from client to server, where they will execute faster. Likewise,
stored functions called from SQL statements enhance performance by executing
application logic within the server.

3-1-2 Productivity and Ease of Use :-

By designing applications around a common set of stored procedures, you can


avoid redundant coding and increase your productivity. Moreover, stored
procedures let you extend the functionality of the RDBMS. For example, stored
functions called from SQL statements enhance the power of SQL.
You can use the Java integrated development environment (IDE) of your choice
to create stored procedures. Then, you can deploy them on any tier of the
network architecture. Moreover, they can be called by standard Java interfaces
such as JDBC, CORBA, and EJB and by programmatic interfaces and
development tools such as SQLJ, the OCI, Pro*C/C++, and JDeveloper.

3-1-3 Scalability:-

Stored procedures increase scalability by isolating application processing on the


server. In addition, automatic dependency tracking for stored procedures aids
the development of scalable applications.

3-1-4 Maintainability:-

Once it is validated, a stored procedure can be used with confidence in any


number of applications. If its definition changes, only the procedure is affected,
not the applications that call it. This simplifies maintenance and enhancement.
Also, maintaining a procedure on the server is easier than maintaining copies on
various client machines.

3-1-5 Interoperability:-

The RDBMS allows a high degree of interoperability between Java and


PL/SQL. Java applications can call PL/SQL stored procedures using an
embedded JDBC driver. Conversely, PL/SQL applications can call Java stored
procedures directly.

3-1-6 Security:-

You can restrict access to Oracle data by allowing users to manipulate the data
only through stored procedures that execute with their definer's privileges. For
example, you can allow access to a procedure that updates a database table, but
deny access to the table itself.

3-1-7 Replication:-

With Oracle Advanced Replication, stored procedures can be replicated


(copied) from one Oracle8i database to another. This feature makes them ideal
for implementing a central set of business rules. Once written, the stored
procedures are replicated and distributed to work groups and branch offices
throughout the company. In this way, policies can be revised on a central server
rather than on individual servers.
Create Function
Jason Price, in 2013 [10] the create function statement to create a
standalone stored function or a call specification.

A stored function (also called a user function or user-defined function) is a set


of PL/SQL statements you can call by name. Stored functions are very similar
to procedures, except that a function returns a value to the environment in which
it is called. User functions can be used as part of a SQL expression. A call
specification declares a Java method or a third-generation language (3GL)
routine so that it can be called from SQL and PL/SQL. The call specification
tells Oracle Database which Java method, or which named function in which
shared library, to invoke when a call is made. It also tells the database what type
conversions to make for the arguments and return value.

COMMIT Statement :-
In Oracle 12C Database, the COMMIT statement commits all changes for
the current transaction. Once a commit is issued, other users will be able to see
your changes as shown in figure (3-). The syntax for the COMMIT statement in
Oracle/PLSQL is :

COMMIT [ WORK ] [ COMMENT clause ] [ WRITE clause ] [ FORCE clause


];

Figure (3-) Commit Statement

Create Trigger:-
A trigger is a named program unit that is stored in the database
and fired (executed) in response to a specified event. The specified event is
associated with either a table, a view, a schema, or the database, and it is one of
the following:
 A database manipulation (DML) statement .
 A database definition (DDL) statement .
 A database operation .

Figure (3-) create trigger

States Of Triggers :-
A trigger can be in either of two states ( Enable and Disable ) :-

Enabled. An enabled trigger executes its trigger body if a triggering statement is


entered and the trigger restriction (if any) evaluates to TRUE.

Disabled. A disabled trigger does not execute its trigger body, even if a
triggering statement is entered and the trigger restriction (if any) evaluates to
TRUE .

By default, a trigger is created in enabled state. To create a trigger in disabled


state, use the DISABLE clause of the CREATE TRIGGER statement.

Create view:-
Use the statement to define a view, which is a logical table based on one or
more tables or views. A view contains no data itself. The tables upon which a
view is based are called base tables. Views are virtual tables formed by a query.
A view is a dictionary object that you can use until you drop it. Views are not
updatable. If a qualified view name is specified, the schema name cannot begin
with SYS.

A view operates with the privileges of the owner of the view. See "Using SQL
standard authorization" and "Privileges on views, triggers, and constraints" in
the Java DB Developer's Guide for details.

The view owner automatically gains the SELECT privilege on the view. The
SELECT privilege cannot be revoked from the view owner .The view owner
can only grant the SELECT privilege to other users if the view owner also owns
the underlying objects.

The privilege to grant the SELECT privilege cannot be revoked. If a required


privilege on one of the underlying objects that the view references is revoked,
then the view is dropped.

Create table:-
The create table statement to create one of the following table as shown in
figure (3-) :-

Figure (3-) create table

 A relational table :- which is the basic structure to hold user data as


shown in figure (3-).

Figure (3-) relational table

 An object table :- which is a table that uses an object type for a column
and hold object instances of a particular type as shown in figure (3-).

Figure (3-) Object table


Employee Information Table
Create table called employee information content from Id number (
primary key) , username and password . this table is used when employee want
show specific table or make new register to customers .

Customer Information table


Create table called ( customer information ) content Id number (primary
key) automatically increase , full name , electronic mail ,nationality , passport
number and disables. This table used to make account to customer in Bank as
shown in figure (3-).

Figure (3-) Flowchart of customer information

General Ledger table:-


Create table called (general ledger ) content GL-code , Long- Desc-eng
and GL-type . this table used to describe type of assets , liabilities and other
type as shown in figure (3-)
Figure (3-) General Ledger

Transactions table:-

Create table called (transaction ) content from_name , to_name , account


and amount. This table is used to describe from customer to another one . type
of transaction is Deposit and withdrawal as shown in figure (3-).

Figure (3-) Flow Chart to Deposit and withdrawal

Account table
Create table called (account table) content customer Id (PK) ,Branch Id,
Currency number, and GL number . this is used to record information of
account .

GUI ( graphic unit interface)


GUIs are potentially very complex entities because they involve a large
number of interacting objects and classes. Each onscreen component and
window is represented by an object, so a programmer starting out with GUIs
must learn many new class, method, and package names. In addition, if the GUI
is to perform sophisticated tasks, the objects must interact with each other and
call each other’s methods.

Java Swing
Java swing was developed to provide a more sophisticated set of GUI
components . Swing provides several advanced components such as tabbed
panel, scroll panes , trees, table and lists as shown in figure (3-).

Figure (3-) Java Swing Class


Java SWT (Standard Widget Toolkit) :-
The SWT implementation access the native GUI libraries of the operating
system using java Native Interface (JNI) that is similar to those programs
written using operating system – specific application programming interfaces
(APIs) as shown in figure (3-) .

Figure (3-) Hierarchy Of SWT

Java AWT(Abstract Window Toolkit):-


The AWT is java’s original platform- dependent windowing , graphic and user
– interfaces widget toolkit , preceding Swing . The AWT is part of the Java
Foundation Classes (JFC) as shown in figure (3-) .
Figure (3-) Hierarchy of Java AWT

You might also like