Database System Concepts: JDBC and GUI Development, Study notes of Object Oriented Programming

An overview of database system concepts, focusing on jdbc and gui development. It covers topics such as application architectures, database connectivity, odbc, jdbc, and sql with java. The document also discusses the role of java communication with a web server and servlets in handling complex applications.

Typology: Study notes

2010/2011

Uploaded on 09/03/2011

krithika
krithika šŸ‡®šŸ‡³

4.4

(58)

96 documents

1 / 54

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
OOM 02
OOM 02
By
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36

Partial preview of the text

Download Database System Concepts: JDBC and GUI Development and more Study notes Object Oriented Programming in PDF only on Docsity!

OOM 02OOM 02

By

OOM for Software Project: ATM case study OOM for Software Project: ATM case study

 (^) The software to be designed & developed will control a Simulated Automated Teller Machine (ATM) having;

a magnetic stripe reader for reading an ATM card,

a customer console (keyboard and display) for

interaction with the customer,

a slot for depositing envelopes, a dispenser for cash (in

multiples of Rs.100/),

a printer for printing customer receipts, and a key

operated switch to allow an operator to start or stop the machine.

The ATM will communicate with the bank's computer

over an appropriate communication link and will interact with Bank Database.



12/09/14 2

User Interfaces and Tools User Interfaces and Tools

 (^) Most database users in Applications do not use a query

language like SQL for the Data Manipulation. Why?

Forms

Graphical user interfaces

Data analysis tools

 (^) Many interfaces are Webbased.

 (^) It becomes needful to develop the capabilities at Userlevel

so that a user's commands are delivered to the database, and the results of those statements are sent back to the user via Forms / GUI / Data Analysis tools.

OOM Project: Architecture OOM Project: Architecture

12/09/14 5

The project environment often requires to prepare Program modules and incorporate domain related Business rules at Front endFront end and Data with all its technical specification at the other endother end.

Both the application codes and Data may be on same or different machine.

Database Connectivity Database Connectivity

 (^) Native Drivers

 (^) ODBC

 (^) With Java

Using Web server

Using proprietary Server

Using JDBC

12/09/14 7

Data Base Connectivity : Native Drivers Data Base Connectivity : Native Drivers  (^) Native drivers give you the raw power of talking directly to your database.

 (^) When we make the connection and retrieve data, we are talking right to the file system.

 (^) An example of a native driver is the Oracle Call Interface, or OCI from Oracle Corporation for Oracle databases.

 (^) Native drivers are usually statically or dynamically linked into your software at compile time.

Advantages

 (^) Very fast with the actual database access code linked together with your program, data access is lightning fast.

Disadvantages

 (^) Not portable applications created in this manner are usually not portable to other platforms without code modifications.

 (^) Inflexible because the driver is linked into your application, changes in the driver software require possible recompilation of your application.

8

Software Layers to handle Data Software Layers to handle Data

12/09/14 10

Database traditionally handled through SQL queries requires Data base connectivity – ODBC. ODBC further needs Native drivers to establish connection

ODBC ODBC

Advantages

 (^) Fast Not as fast as native drivers, but pretty fast. You have

one additional layer of software to go through to get to your data.

 (^) SQL Enabled You can use SQL to query the database.

Disadvantages

 (^) Not portable Applications created in this manner are

usually not portable to other platforms without code modifications.

 (^) Inflexible Because the driver stub is linked into your

application, changes in the driver software API require possible recompilation of your application

12/09/14 11

Databases and Java Databases and Java

 (^) Java is a platform independent programming language. In

order to access a database with Java you need to use a platformindependent method.

 (^) This is easy to accomplish, but might be quite cumbersome.

Usually, you'd have to create a server program that speaks to the database of your choice and then your Java programs would need to interact with your server.

 (^) If you want to abandon your platform independence, you

can write native code to access your data. This would involve C or C++ programming in UNIX or Windows 95/NT. Without the proper tools, this can be a real headache.

12/09/14 13

Databases with Java Databases with Java

 (^) So what does a programmer do when he needs data access

from Java?

 (^) There are several ways to get data to your application. These

database access services include:

 (^) Access via Web Server. The client requests data and a CGI

program talks to the database and returns the formatted data to the Java program.

 (^) Proprietary Server. The proprietary server knows how to

talk to databases. Your Java program makes requests of this server, which in turn fulfills your requests.

12/09/14 14

Databases with Java Databases with Java

 (^) The latest arrival onto the database scene is Sun

Microsystem's own Java Database Connectivity, or JDBC.

 (^) To set an independent database standard API for

Java, Sun Microsystems developed JDBC.

 (^) JDBC is an API for the Java programming language that

defines how a client may access a database. It provides methods for querying and updating data in a database.



12/09/14 16

JDBC offers JDBC offers

 (^) JDBC offers a generic SQL database access

mechanism that provides a consistent interface to a

variety of RDBMSs.

 (^) This consistent interface is achieved through the use

of "plugin " database connectivity modules, or drivers.

 (^) If a database vendor wishes to have JDBC support, he

or she must provide the driver for each platform that

the database and Java run on.

12/09/14 17

JDBC JDBC

 (^) The latest version of JDBC is 3.0 and is a part of the J2SE

1.4.

 (^) JDBC 3.0 is broken down into two packages:

  1. java.sql. Referred to as the JDBC Core API.

  2. javax.sql. Referred to as the JDBC Optional Package API. (In JDBC 2.0,

 (^) This package was formerly known as the JDBC Standard

Extension API.

 (^) JDBC provides the same capabilities as ODBC, allowing

Java programs to contain databaseindependent code.

 (^) This means that a Java program that accesses a database is

not only portable across JVMs (since it’s a Java program), but portable across databases, since it uses JDBC.

12/09/14 19

JDBC drivers JDBC drivers

 (^) To connect to a database and access its contents,

we need a JDBC driver that works with that particular database.

 (^) JDBC drivers fit into four categories referred to as

types, which depend on the applications.

 (^) JDBC helps you to write java applications that manage these three programming activities:

  1. Connect to a data source, like a database

  2. Send queries and update statements to the

database

  1. Retrieve and process the results received from the

database in answer to your query

12/09/14 20