0% found this document useful (0 votes)
15 views21 pages

5-8(jan)

The document provides a comprehensive overview of Core Java, covering programming components, concepts, and object-oriented programming features. It categorizes applications into stand-alone, web, enterprise, and mobile applications, and discusses storage types including field, object, file, and database storage. Additionally, it explains JDBC and its importance in connecting Java programs to databases, along with the steps for establishing this connection.

Uploaded by

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

5-8(jan)

The document provides a comprehensive overview of Core Java, covering programming components, concepts, and object-oriented programming features. It categorizes applications into stand-alone, web, enterprise, and mobile applications, and discusses storage types including field, object, file, and database storage. Additionally, it explains JDBC and its importance in connecting Java programs to databases, along with the steps for establishing this connection.

Uploaded by

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

Dt : 5/1/2024(day-1)

Review of CoreJava:(Summary of CoreJava)

1.Programming Components(Java Alphabets)

2.Programming Concepts

3.Object Oriented Programming features

i
thi
1.Programming Components(Java Alphabets)

a.Variables

ipa
b.Methods
Ma
c.Constructors

d.Blocks

e.Classes
sh
f.Interfaces
ate

g.AbstractClasses
nk

2.Programming Concepts

a.Object Oriented programming


Ve

b.Exception Handling process

c.Java Collection Framework(JCF)

(data structures in Java)

d.Multi-Threading process

e.IO Streams and Files(JavaProgram - File Storage)


f.Socket programming in Java(Networking in Java)

3.Object Oriented Programming features

a.Class

b.Object

i
c.Abstraction

thi
d.Encapsulation

e.PolyMorphism

ipa
f.Inheritance
Ma
--------------------------------------------------------------------

Output of CoreJava:

(i)Constructing Object Oriented Programs


sh
(ii)Can develop StandAlone Applications
ate

===================================================================
====

define program?
nk

=>program is a set-of-Instructions.
Ve

define Application?

=>set-of-programs collected together to perform defined task is known as

Application.
Types of Applications:

=>Applications are categorized into four types:

1.Stand-Alone Applications

2.Web Applications

3.Enterprise Applications

i
4.Mobile Applications

thi
1.Stand-Alone Applications:

ipa
=>The applications which are installed in one computer and performs actions
Ma
in the same computer are known as Stand-Alone Appliactions or DeskTop

Applications or Windows Applications

=>Based on User interaction the Stand-Alone applications are categorized into


sh
two types:
ate

(i)CUI Applications

(ii)GUI Applications
nk

(i)CUI Applications:
Ve

=>The applications in which the user interacts through 'console' are known as

CUI Applications.(CUI - Console User Interface)

(ii)GUI Applications:

=>The applications in which the user interacts through 'gui components' are
known as GUI Applications.(GUI - Graphical user Interface)

=>We use the following to construct GUI components:

AWT - (Abstract Window Toolkit)

swing

JavaFx

i
Note:

thi
=>CoreJava Components,Concepts and features are used to develop
Stand-Alone

ipa
Applications,which means NonServer Applications

---------------------------------------------------------------------------
Ma
2.Web Applications:

=>The applications which are executing in Web Environment or Internet


sh
Environment are known as Web Applications or Internet Applications.

=>we use the following technologies to construct Web Applications:


ate

(i)JDBC

(ii)Servlet
nk

(iii)JSP
Ve

Web Application Architecture:


i
thi
ipa
Ma
(i)JDBC:
sh
=>JDBC stands for 'Java DataBase Connectivity' and which is used to establish
ate

communication to Database product.


nk

(ii)Servlet:

=>Servlet means Server-program and which accepts the request from User.
Ve

(iii)JSP:

=>JSP stands for 'Java Server page' and which is response from Web
Application
Note:

=>AdvJava includes these three technologies.

----------------------------------------------------------------------------

3.Enterprise Applications:

=>The applications which are executing in distributed environment and


depending

i
thi
on the features like 'Security','LoadBalancing' and 'Clustering' are knwon

as Enterprise Applications or Enterprise Distributed Applications.

ipa
----------------------------------------------------------------------------

4.Mobile Applications:
Ma
=>The applications which are executed in mobile environment are known as

Mobile Applications.
sh
===================================================================
==========
ate

*imp

define Storage?
nk

=>The memory location where data is available for accessing is known as


Storage.
Ve

Types of Storages:

=>According to Java Application development,the Storages are categorized into

four types:

1.Field Storage
2.Object Storage

3.File Storage

4.Database Storage

1.Field Storage:

i
=>The memory generated to hold single data value is known as Field Storage.

thi
=>The Primitive datatypes will generate Field Storages.

(byte,short,int,long,float,double,char,boolean)

ipa
Ma
2.Object Storage:

=>The memory generated to hold group members is known as Object Storage.

=>The NonPrimitive datatypes will generate Object Storages.


sh
(Class,Interface,Array,Enum)
ate

-----------------------------------------------------------------------------

Dt : 6/1/2024(day-2)
nk

Ex:

class Addition
Ve

int a;

int b;

void add()

{
int c = a+b;

System.out.println("Sum:"+c);

i
Addition ob = new Addition();

thi
Diagram:

ipa
Ma
sh
ate
nk
Ve

----------------------------------------------------------------

faq:

wt is the diff b/w

(i)Object

(ii)Object reference
(iii)Object reference Variable

(i)Object:

=>The memory generated to hold group members is known as Object.

i
(ii)Object reference:

thi
=>The address location where object is created,is known as Object reference.

ipa
(iii)Object reference Variable:
Ma
=>The NonPrimitive datatype variable which hold Object reference is known as

Object reference variable or Object Name.

------------------------------------------------------------------------
sh
*imp
ate

Object Oriented programming levels:

1.Object definition
nk

2.Object creation

3.Object Location
Ve

4.Object Components

5.Object Types

(a)User defined class Objects

(b)string-Objects

(i)String Class Objects


(ii)StringBuffer Class Objects

(iii)StringBuilder Class Objects

(c)WrapperClass Objects

(i)Byte Object

(ii)Short Object

i
(iii)Integer Object

thi
(iv)Long Object

(v)Float Object

ipa
(vi)Double Object
Ma
(vii)Character Object

(viii)Boolean Object

(d)Array Objects
sh
(i)Array holding User defined class Objects
ate

(ii)Array holding String Objects

(iii)Array holding WrapperClass Objects


nk

(iv)Array holding dis-similer objects(Object Array)

(v)Array holding Array-Objects(Jagged Array)


Ve

(e)Collection<E> Objects

1.List<E> Objects

(i)ArrayList<E> Objects

(ii)LinkedList<E> Objects

(iii)Vector<E> Objects
=>Stack<E> Object

2.Queue<E> Objects

(i)PriorityQueue<E> Objects

=>Deque<E>

(ii)ArrayDeque<E> Objects

i
(iii)LinkedList<E> Objects

thi
3.Set<E> Objects

(i)HashSet<E> Objects

ipa
(ii)LinkedHashSet<E> Objects
Ma
(iii)TreeSet<E> Objects

(f)Map<K,V> Objects

(i)HashMap<K,V> Objects
sh
(ii)LinkedHashMap<K,V> Objects
ate

(iii)TreeMap<K,V> Objects

(iV)Hashtable<K,V> Objects
nk

(g)Enum<E> objects

6.Objects Colletion(Grouping Objects)


Ve

7.Objects Sorting

8.Object Locking

9.Object Serialization

10.Object Cloning
===================================================================
==

Note:

=>Field Storages in Java can be at three levels:

1.Class Level - Static Variables(Class Variables)

i
thi
2.Object Level - Instance Variables(Object Variables)

3.Method Level - Local Variables(Method Variables)

ipa
===================================================================
==

Note:
Ma
=>The Field Storages and Object Storages,which are created part of JavaApp in

JVM are destroyed automatically when JVM ShutDowns,but Applications


sh
needs

permanent storages and we use any one of the following:


ate

=>File Storage

=>Database Storage
nk
Ve
i
thi
ipa
Ma
===================================================================
==
sh
Dt : 7/1/2024
ate

faq:

define API?
nk

=>API stands for 'Application Programming Interface' and which is a Platform

for developers to develop applications using Language or Technology or


Ve

Framework.

=>In Java,each package is one API and which is collection of 'Classes and

Interfaces'.

=>The following are some important APIs from Java:

java.lang - Language API


java.util - Collection Framework API

java.io - IO Streams and File API

java.net - Networking API

java.sql - JDBC API

javax.servlet - Servlet Programming API

i
javax.servlet.jsp - JSP Programming API

thi
-----------------------------------------------------

java - represents Java Library

ipa
javax - represents Extended Java Library
Ma
===================================================================
==

3.File Storage:
sh
=>The smallest permanent storage of ComputerSystem which is 'controlled and

managed' by the OperatingSystem is known as File Storage.


ate

=>In the process of establishing communication b/w Java-Program and


DB-Product,
nk

the Java-Program must be constructed using 'Classes and Interfraces'


available
Ve

from 'java.io' package.

Diagram:
i
thi
ipa
Ma
sh
-------------------------------------------------------------------------

Dis-Advantage of File Storage:


ate

1.Data redundancy

2.Data Inconsistency
nk

3.Data Integrity problem

4.Data Sharing Problem


Ve

5.Data Security Problem

1.Data redundancy:

=>File Storage leads to Data replication,known as Data redundancy.


2.Data Inconsistency:

=>Because of Data replication,InConsistent data is generated.

(which means different data related to users)

i
3.Data Integrity problem:

thi
=>File Storage will not support data Integrity,which means combining the data

available in Scatter-form

ipa
Ma
4.Data Sharing Problem:

=>File Storage will not Support data Sharing.


sh
5.Data Security Problem:
ate

=>File Storage cannot provide security for data.

===================================================================
nk

Note:
Ve

=>Because of File Storage dis-advantages,we are not using File Storage as

major backend for applications.

===================================================================
======

Dt : 8/1/2024
*imp

4.Database Storage:

=>The largest permanent storage of ComputerSystem which is installed from

externally is known as database Storage.

=>To establish communication b/w JavaProgram and Database product,the


JavaProgram

i
thi
must be constructed using 'classes and Interfaces' from java.sql package and

the program must take the support of JDBC-driver

ipa
Diagram:
Ma
sh
ate
nk
Ve

-----------------------------------------------------

faq:

define driver?

=>Small s/w program which is used to interlink two end-points for


communication
is known as driver.

=>OperatingSystem is in-built with many drivers like,

Audio driver

Video driver

N/W driver

i
...

thi
-------------------------------------------------------------

faq:

ipa
define JDBC driver?
Ma
=>The driver which is used to interlink JavaProgram and Database product,is

known as JDBC driver(Java DataBase Connectivity - driver)

=>These JDBC drivers are categorized into four types:


sh
1.JDBC-ODBC bridge driver(Type-1)
ate

2.Native API driver(Type-2)

3.Network Protocol driver(Type-3)


nk

4.Thin driver(Type-4)

--------------------------------------------------------------------
Ve

*imp

Make ComputerSystem environment ready for executing JDBC Applications:

Step-1 : Download and Install Database product(Oracle)

step-2 : Perform Login process and check Database is working or not

step-3 : Create the table with name "User58"


(uname,mid,phno)

create table User58(uname varchar2(15),mid varchar2(25),phno number(15),

primary key(uname));

step-4 : Insert min 5 user details into table

i
insert into User58 values('Alex','[email protected]',9898981234);

thi
step-5 : Copy DB Jar file into User defined folder

ipa
Note:
Ma
=>DB Jar file is available in 'lib' folder of Oracle-Installed-folder

C:\oraclexe\app\oracle\product\11.2.0\server\jdbc\lib

ojdbc6 - Oracle11
sh
faq:
ate

define JAR?

=>JAR stands for Java Archieve and which is compressed format of more
class-files
nk
Ve

step-6 : Find PortNo and Service_name of Database product

Note:

=>Open tnsnames.ora file from 'Admin' folder of 'network' to find PortNo and

Service_name

C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
PortNo : 1521

Service_name : XE

===================================================================
============

*imp

i
thi
we use the following steps to establish connection b/w JavaProgram and DB
product:

ipa
step-1 : Loading driver

step-2 : Creating Connection


Ma
step-3 : Preparing statements

step-4 : Executing queries

step-5 : Closing Connection


sh
===================================================================
ate

===========

*imp

JDBC API:
nk

=>java.sql package is known as JDBC-API and which provide the 'Classes and
Ve

Interfaces' used to construct JDBC Applications.

=>'java.sql.Connection' interface is the root of JDBC-API.

=>The following are some important methods of 'Connection' interface:

1.createStatement()

2.prepareStatement()
3.prepareCall()

4.setAutoCommit()

5.getAutoCommit()

6.setSavepoint()

7.releaseSavepoint()

i
8.commit()

thi
9.rollback()

10.close()

ipa
-------------------------------------------------------------------------
Ma
sh
ate
nk
Ve

You might also like