This post originated from an RSS feed registered with Java Buzz
by instanceof java.
Original Post: IO Streams
Feed Title: Instance Of Java
Feed URL: http://feeds.feedburner.com/blogspot/TXghwE
Feed Description: Instance of Java. A place where you can learn java in simple way each and every topic covered with many points and sample programs.
The environment that allows us to store data permanently is called persistent media.
We can store data permanently in three places
File
Database
Remote Computer
Persistence:
The process of storing data permanently in a persistence media.
Persistence Logic:
The logic that persist data in a persistence media is called persistence logic.
Ex: IOStreams based logic, JDBC logic, Networking based logic.
Persistence Technologies:
The technology that provides API to develop persistence logic is called persistence technology.
Well known persistence technologies are
IOStreams : to persist data in files
JDBC, EJB, Hibernate: to persist data in db
Networking: to persist data in remote computer
Where can we store data permanently?
In persistence medias either files or in databases.
Storing data in variables and arrays is temporary. Data will be lost when a local variable goes out of scope or when the program terminates.
programmers use files or databases for long term storage of large amount of data. it is available even after termination of the program. We refer to data maintained on files as persistent data, because the data exists beyond the duration of the program execution.
To store data in files and databases Oracle has given in built API. We all need to do is creating the particular class object calling methods for storing and reading data from that persistence media.
IOStreams API is given to store and read data from files
JDBC API is given to store and read data from Databases.
How java application can store or read data from a file?
Using stream object.
Introduction to Streams:
Stream is logical connection between java program and a file.
To store the data in the persistence media there should be a way to connect to persistence media from java application either physically or logically. Stream provides logical connection.
"Its a continuous flow of data between java program and persistence media"