Informācijas sistēmas uzbūves tipiska struktūra Web view01/09/2012 · to existing...
Transcript of Informācijas sistēmas uzbūves tipiska struktūra Web view01/09/2012 · to existing...
Datu bāzes sistēmaLietojumu serveris
Objektu-relāciju
attēlojums (ORM)
Informācijas sistēmas arhitektūra
Datu bāzes
serveris(DBVS)
Dat
u bā
zes i
nter
feis
s
Plānais (thin) klients Datu bāze
Dati un meta-dati
Servera procedūras
(progr. valodas PL/SQL, Java un
citas)
Universālā datu bāze:1) relāciju datu bāze;2) objektu datu bāze;3) relāciju-objektu datu bāze;4) XML datu bāze.
Datu bāzes interfeisi:1) ODBC;2) OLE DB;3) ADO;4) JDBC.
Lietojumu servera uzdevumi:1) lieli lietojumi;2) web serveris;3) transakciju serveris.
Biezais (thick, fat)
klients
Lietojumu programmas, glabājamās procedūras un trigeri
1. Use client-side programming to embed SQL statements in applications written in procedural languages such as C, C++, or Java.1) You can place SQL statements in source code and submit it to a precompiler or Java translator before compilation. 2) You can eliminate the precompilation step and use: - an API such as Java Database Connectivity (JDBC); - Oracle Call Interface (OCI) to enable the application to interact with the database.
2. Use server-side programming to develop data logic that resides in the database. An application can explicitly invoke stored subprograms (procedures and functions), written in PL/SQL or Java. You can also create a trigger, which is named program unit that is stored in the database and invoked in response to a specified event.
Lietojumu programma
Datu bāzes sistēma
Datu bāze
Glabājamā procedūra (stored
procedure) programma
TrigerisDati un
metadati
DBVS
2
Kāpēc programmēšana datu bāzes serverī?
1. All programs reside in one machine called the Server. Any number of remote machines (called clients) can access the server programs.
2. New functionalities to existing programs can be added at the server side not client.
3. Migrating to newer versions, architectures, design patterns, adding patches, switching to new databases can be done at the server side without having to bother about clients? hardware or software capabilities.
4. Issues relating to enterprise applications like resource management, concurrency, session management, security and performance are managed by service side applications.
3
Klienta – servera sistēma izmantojot Oracle DBVS
4
Java glabājamās procedūrasJava programmu izmantošanas datu bāzes serverī
Datu bāzes sistēma
TabulaK1 K2 K3 K4
PL/SQL programmas čaula
DB glabājamā procedūra Java programmēšanas
valodā
5
Java programmas izpildes varianti
6
Java programmu darbība
Parasts Java lietojums Java lietojums ar DBVS Oracle
Java Database Connectivity (JDBC), which is a standard Java API for database independent connectivity between the Java programming language and a wide range of databases.The JDBC library includes APIs for each of the tasks commonly associated with database usage:
1) making a connection to a database2) creating SQL 3) executing that SQL in the database4) viewing & modifying the resulting records
The Java Naming and Directory Interface (JNDI) is part of the Java platform, providing applications based on Java technology with a unified interface to multiple naming and directory services. You can build powerful and portable directory-enabled applications using this industry standard.
SQLJ is an outdated working title for efforts to combine Java and SQL. It was a common effort started around 1997 by engineers from IBM, Oracle, Compaq, Informix, Sybase, Cloudscape and Sun Microsystems.
Java lietojums
Java virtuālā mašīna
Operētājsistēma
Java servera lietojums
Oracle Java API: JDBC, JNDI, SQLJ
Java kodola bibliotēkas
Oracle DB Java virtuālā mašīna
Oracle DB bibliotēkas
Operētājsistēma
Java kodola bibliotēkas
7
Java Memory Areas
In OracleJVM, the states of Java objects are preserved in special data structurescalled “object memories.” There are several object memory types:
1) newspace is the default memory for allocating almost all Java objects, except large objects, which are allocated in Oldspace.
2) oldspace is an object memory used for holding long-lived or large objects (i.e., larger than 1-K Bytes) for the duration of a call.
3) runspace is an object memory residing in CGA or PGA and is used to hold system objects (e.g., classloader objects) allocated for the duration of a call.
4) stackspace is an object memory residing in CGA or PGA and is used to allocate system objects and objects used by the Java interpreter (no user objects);
5) sessionspace, also called “session memory,” is an object memory residing in the User Global Area (UGA), which is associated with each session (each session has its own Sessionspace) and lives as long as the session lives. Sessionspace is used to preserve state of system objects, user objects, and metadata used by the Java runtime.
8
Java atmiņas apgabali izdalītā servera gadījumā
9
Java atmiņas apgabali koplietojuma servera gadījumā
10
A Java application may result in:1) of bytecodes (interpreted);2) natively compiled binaries. Therefore, the natively compiled code must be fully interoperable with the Java VM. The native compiler has been designed to generate C code that allows natively compiled routines to call (and be called from) interpreted Java bytecode.
11
12