. , , ,

,,,

,

()

- ..

:

..

,

..

,

..

,

/𠠠 ..

,

򠠠 ..

,

ࠠ -03-3

:

_______ ..

______ ..

2008 .


()

- ..

.

______________ /________/

20__.

1.  () һ

18 2008 . 273/18

2.  ()

3.  () ; ӻ; .

4.  - ( ) ; ; ; Apache-Tomcat 5.5.20 Oracle Database 10g; .

5.  ( ) ; ; ; ; .

6.  (, )

,
..
..

7. 

 

________________________ ..

________________________ ..

..


/

() ()
1 18.02
2 19.02-29.02
3 1.03-6.03
4 , 7.03-17.03
5 18.03-5.04
6 6.04-24.04
7 25.04-27.04
8 28.04-2.05
9 3.05-4.05
10 5.05-14.05
11 15.05-20.05

___________________________ ..

___________________________ ..

___________________________ ..


91 ., 32 , 10 , 10 .

, JAVA, ORACLE DATABASE, SUSE LINUX ENTERPRISE, APACHE-TOMCAT, , JDBC-, JSP, , , , , , .

, , Java web-, Oracle Database.

, .

, , , , , .

, ; ; , , .


1

1.1

1.2 Oracle

1.3 Java

1.3.1 JDBC

1.3.2

1.3.3 JSP

1.4 SUSE Linux Enterprise 10

1.5 /

1.5.1

1.5.2 Java Oracle Database

2

2.1

2.1.1 λ

2.1.2

2.1.3

2.1.4

2.2

2.2.1 Oracle

2.2.2

2.2.3

2.2.4

2.2.5

2.3

2.3.1 Apache-Tomcat 5.5.20

2.3.2 Oracle Database 10g

2.4

2.4.1

2.4.2

2.4.3

2.5

2.5.1

2.5.2

2.5.3

2.5.4

3 -

3.1

3.2

3.3

3.4

3.5

4

4.1.

4.1.1. ,

4.1.2. ,

4.1.3.

4.1.4 -

4.1.5 .

4.1.6

4.1.7.

4.1.8.

4.2

4.2.1 ()

4.2.2. ().


. .

() . : .

HTML (Hyper Text Markup Language) -.

.

. , . , . , , .

. , , , . :

- // (, , );

- ;

- ;

- .

:

- ;

- ;

- .

. -, , . , -, .

, Oracle Database 10g Java.


1

 

1.1

, . . , .

, , .

-, . . ; ; , , . : , . . . . - : , .

-, , . :

- : , , , , , .. , "";

- , , , , . ;

- , , , - , . . (, , , , ) . , , , , . , - .

. , , , , . World Wide Web , ( ) .

-, . . , , , . . , , . . , - . , , .

, "" , , , .

, . , : , .

, , . , , ( , , . .). - , , , , - - , .

, , , , . :

- , , , , , , "" ;

- , , - ;

- , - , , ;

- - ;

- ;

- - , , , , .

, "" . , Web-CD, , , , , . , , , , , .

, , , - , , , .

1.2 Oracle

Oracle, Java , . , . Oracle, . . -, . Oracle NT, , MS SQL. UNIX-, , UNIX Oracle , . , . , Oracle , LINUX WEB (www.oracle.com) . , Oracle - , .

Oracle , :

1) - (large-database partition), ;

2) ;

3) ;

4) ;

5) ( );

6) ;

7) , ;

8) .

, Oracle DB2 IBM. - Oracle. interMedia, , Jserver, Java, Java ( Java ( ), Enterprise JavaBeans ). Enterprise JavaBeans - Java [1].

Oracle , , interMedia :

- ;

- ;

- ;

- ( Locator ).

Oracle - , , , .

, Oracle (multiversioning concurrency) Oracle ( InterBase Borland). , , (.. Oracle ). Oracle , . WEB LINUX Oracle MySQL, [2].

1.3 Java

Java ( 23 1995 .) , .

Java .

, Java . JavaBeans, Java , CORBA.

EJB (Enterprise JavaBeans). JDBC (Java DataBase Connection). , , Java , Oracle, Linux, MacOS X, AIX. , Java . - .

Java , , , Java. Smalltalk, Pascal, C++ ., , , . , , , , : . Java - , , Pascal . Java , , [3].

, Java Java, , Pascal C++, - Java; . , Java - , Algol, Pascal.

 

1.3.1 JDBC

, . . , ( ) - . , . . .

ODBC (Open Database Connectivity), Microsoft. , . , , ODBC. ODBC, . , , , .

SUN , JDBC, . java.sql, J2SDK Standard Edition, javax.sql, J2SDK Enterprise Edition.

JDBC , JDBC. JDBC.

1. , JDBC ODBC. (bridge) JDBC-ODBC. ODBC.

2. , JDBC API .

3. , JDBC , . , , .

4. , JDBC .

. connection. , , getConnection () DriverManager, :

String url = "jdbc:odbc:mydb";

String login = "habib";

String password = "lnF4vb";

Connection con = DriverManager.getConnection(url, login, password);

url "jdbc:", (subprotocol), JDBC-ODBC, "odbc:". (subname) , "mydb". .

javax.sql, DriverManager DataSource.

, . , Statement. createStatement (), onnection, :

Statement st = con.createStatement();

(query) execute () getResultSet(). executeQuery (), :

ResultSet rs = st.executeQuery("SELECT name, code FROM tbl1");

tbl1 name code rs , ResultSet.

SQL- INSERT, UPDATE, DELETE, CREATE TABLE executeUpdate ().

next () rs getxxx () ResultSet, :

while (rs.next()){

emp[i] = rs.getString("name") ;

num[i] = rs.getlnt("code");

i++; }

ResultsetMetaData , , , rs [3].

, JDBC .

1.3.2

HTTP- : , . HTTP URL.

. , CGI ( Gateway Interface). CGI , . Perl. , CGI-. : PHP, ASP, JavaScript.

Java JSP (JavaServer Pages).

(servlets) Web- , , . , (servlet container), "" , , , , , . , . " ", "servlet engine", , " ".

Web-, , (application server, AS).

, , "Java Servlet Specification" (deploy) . (deployment) , . . , , autodeploy/ webapps/, , , J2EE SDK deploytool.

. Java, Web-. Java [3].

Web- . Tomcat, Apache Software Foundition Jakarta, Resin Caucho, JRun Macromedia. Web- .

1.3.3 JSP

JavaServer Pages Web-. JavaServer Pages Web- , . JavaServer Pages JavaBeans , . Web-, Java, Web-, .

JSP : , , . JSP, , JSP . , JSP -. , . Java JSP. (scriptlets), , Java, JSP- (, , Web-) . , . JSP.

JavaServer Pages XHTML- XML-. JSP- XHTML XML. , (fixed template data) . , : JSP. JSP, , Java. , , , . - . , JSP-, . , JSP . , JSP- Web-.

, JSP, JSP-, JSP JSP- Java, JSP-. , . JSP Java, JSP-, _jspService. , JSP _jspService . JSP- Web-, . , , .

/ JSP- . JSP- jspJnit jepDestroy ( init destroy ), , JSP-, , . JSP- JSP JSP [4].

1.4 SUSE Linux Enterprise 10

SUSE Linux Enterprise 10 . SUSE Linux Enterprise 10 , . SUSE Linux Enterprise 10 Novell . SUSE Linux Enterprise 10 Novell, IT- [5].

SUSE Linux Enterprise 10 Novell AppArmor, , . AppArmor , IT- . AppArmor , , . AppArmor , , , , . AppArmor , , .

SUSE Linux Enterprise 10 , Xen 3.0, . Xen 3.0 . Xen 3.0 , . 20%, Xen SUSE Linux Enterprise 10 70%.

SUSE Linux Enterprise , Novell Customer Center. Novell Customer Center , , Novell.

, Novell Customer Center Novell ZENworks. [5].

SUSE Linux Enterprise 10 Novell . Novell , Support Center Practice (SCP) - , IT-. , VARBusiness Annual Report Card Novell , , Novell (SLA) 99%.

SUSE Linux Enterprise . Novell , Intel AMD, 32 64 , . SUSE Linux Enterprise , , Dell, Fujitsu, HP, Lenovo, Silicon Graphics, Sun, Unisys . SUSE Linux Enterprise , , , .

Novell SUSE Linux Enterprise AutoBuild, Novell. AutoBuild , Linux Novell . AutoBuild, Novell , . , AutoBuild Novell SUSE Linux Enterprise . IT-, Linux , grid-, , .

SUSE Linux Enterprise (SDK), , . , SUSE Linux Enterprise 10 , , Web 2.0 Apache Web Server 2.2.0, PHP 5.1, MySQL 5.0, PostgreSQL 8.1, Ruby, Geronimo Apache Tomcat. , SUSE Linux Enterprise , open source Mono .NET [5].

SUSE Linux Enterprise Server , . , :

-           ;

- ;

- ;

- ;

.

SUSE Linux Enterprise Server Novell , Linux. open source , , .

1.5 /

/ :

- ;

- .

. , , . , , . , .. . , .. , . , , / .

, , . -, , , -, , . , .

: . . web-. . web- . html-, (jpeg, gif, flash) JavaScript. CGI-. , , , . . , .

/ :

- ;

- .

, .

, , .

1.5.1

. , .

Borland Delphi , Borland InterBase Server. , , .

PHP MySQL. PHP, - (), , -, . , PHP web-, , .

1.5.2 Java Oracle Database

.. , , .

Java - , , . , . Java web- (, JSP), .

Java , , .

Oracle . . .

Oracle SQL-, .

, Oracle .

1.2.2.1 , , Apache-Tomcat 5.5.20 Oracle Database 10g.

1.2.2.1 -

: , web- . Web- Apache-Tomcat. , . . , jdbc- Oracle . . html , web-. .


2

 

2.1

 

2.1.1 λ

. .

:

- ;

- , , ;

- , , .

, :

- , . ( ), , .

- , , . , , , .

- , .

, .

, , , , , , , .

, .

, , .

, , .

2.1.1.1 λ.

2.1.1.1 λ

. , , 220200 ӻ , . .

. , .

.

, . , , . (, ), , , .

2.1.2

, . . . 2.1.2.1 .


2.1.2.1

, . , , , . , .

, , .

2.1.3

. .. , , . .

, .

. . .

, , , .

, , , flash . .

, .

:

- ;

- ;

- .

, .

, . , .

, .

. , , .

, , .

2.1.3.1 .

2.1.3.1

2.1.4

, , . . .

. , , .

, . , , , , .

, .

2.1.4.1

2.1.4.1

.

2.2

 

2.2.1 Oracle

Oracle - . - (, , , , , , , , ). - Oracle, . . .

() Oracle , . orcl sdo sdo.

:

CREATE USER SDO IDENTIFIED BY SDO DEFAULT TABLESPACE USERS QUOTA UNLIMITED ON USERS

. GRANT. :

GRANT CREATE TABLE TO SDO

sqlplus, , web-, 2.2.1.1. (/) , (;).

2.2.1.1 - SQL*Plus web-

.

, :

CONNECT SDO/SDO;


2.2.2

, ANSI SQL92, Oracle. , Oracle.

: , .

VARCHAR. . , . , 1. 4000 .

VARCHAR2, Oracle. , - Oracle, VARCHAR SQL.

, , 1000 :

varstr1 VARCHAR2(1000)

VARCHAR2 , , , , , ..

INTEGER -231 231.

, :

varint1 INTEGER

, , , , , , .

DATE . 1 4712 . .. 31 4712 . .. DATE SQL PL/SQL _D(' ', ' '). . SYSDATE . , Oracle.

, :

birthday DATE

. DATE Oracle , [6].

DATE .

2.2.3

CREATE TABLE. :

CREATE TABLE Faculty (

facultyID INTEGER NOT NULL,

facultyName VARCHAR2(200) NOT NULL,

facultyShortName VARCHAR2(20) NULL

);

CREATE TABLE , . .

:

ALTER TABLE Faculty ADD ( PRIMARY KEY (facultyID));

, Faculty, , facultyID.

. :

ALTER TABLE Chair ADD (FOREIGN KEY (facultyID)

REFERENCES Faculty ON DELETE SET NULL);

, Chair, facultyID, Faculty. facultyID NULL.

, .

2.2.4

Oracle . , . , , (, ) .

:

CREATE SEQUENCE faculty_seq

- faculty_seq

INCREMENT BY 1

- 1

START WITH 1

- 1

NOMAXVALUE

-

MINVALUE 1

- 1

ORDER

-

;

.


2.2.5

, . . , .

:

create or replace trigger faculty_insert_trig

BEFORE INSERT on Faculty

for each row

begin

SELECT faculty_seq.nextval INTO :new.facultyID from dual;

end;

faculty_insert_trig, Faculty faculty_seq nextval facultyID.

. .

2.3

Linux sk, Oracle Database 10g Apache-Tomcat 5.5.20, . , YaST. ( 2.3.1).

2.3.1

, , , , . , .

, .. root, , , .

2.3.1 Apache-Tomcat 5.5.20

Apache-Tomcat . JDK /usr/local/jdk1.6.0. . /etc/profile:

### Java+Tomcat ###

export JAVA_HOME="/usr/local/jdk1.6.0"

export CATALINA_HOME="/usr/local/apache-tomcat-5.5.20"

export PATH=$PATH:$JAVA_HOME/bin

Apache-Tomcat /usr/local/apache-tomcat-5.5.20/. JDK Apache-Tomcat sk:

chown R sk /usr/local/jdk1.6.0/

chmod 774 / usr/local/jdk1.6.0/

chown R sk /usr/local/apache-tomcat-5.5.20/

chmod 774 /usr/local/apache-tomcat-5.5.20/

Apache-Tomcat /etc/rc.d/tomcat, .

Apache-Tomcat : /etc/rc.d/tomcat start.

http://localhost:8080, web- Apache-Tomcat ( 2.3.1.1).

2.3.1.1 - Web- Apache-Tomcat

Apache-Tomcat /usr/local/apache-tomcat-5.5.20/webapps/.

/usr/local/apache-tomcat-5.5.20/webapps/sdo/.


2.3.2 Oracle Database 10g

Oracle /shared/Oracle10g/. /u01/app/. sk:

chmod R 777 /shared/Oracle10g/

chown R sk /u01

chmod R 775 /u01

.. SuSe Linux Server Edition 10 Oracle, 9- , , .

./runInstaller ignoreSysPrereqs

, /opt/oracle/, , .

chown R sk.wheel /opt/oracle

( 2.3.2.1).

, , Oracle ( 2.3.2.2).

UTF8. orcl.


2.3.2.1 -

2.3.2.2 -

( 2.3.2.3).


2.3.2.3 -

( 2.3.2.4).

2.3.2.4 -

. root, Oracle.

, , Oracle . Oracle.

/etc/oratab N Y, ( - orcl) [7].

/etc/profile:

### Oracle 10g ###

export ORACLE_HOME="/u01/app/oracle"

export ORACLE_SID=orcl

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

export PATH=$PATH:$ORACLE_HOME/bin

/etc/rc.d/oracle , . . Oracle /etc/rc.d./oracle start.

. http://localhost:1158/em Oracle Enterprise Manager. http://localhost:5560/isqlplus, web- PL/SQL.

2.4

- . , . .

-- (MVC, Model-View-Controller). , , , .

JSP, . , . . , . , : , , . , , , . , . , , [8].

, - . Oracle, . . , SQL*Plus web-, , . , , , . .. , .

, , , . . .. UTF-8, [9]:

request.setCharacterEncoding(UTF-8)

 

2.4.1

, , , .. , . .. web-, JavaScript.

:

<form name="form1" method="post" action="FacultyAdd">

<table width="200" border="0">

<tr>

<td> :</td>

<td><input type="text" name="facultyName"></td>

</tr>

<tr>

<td> :</td>

<td><input type="text" name="facultyShortName"></td>

</tr>

<tr>

<td> <div align="center"> <input type="submit" name="Submit" value=""> </div> </td>

<td><input type="reset" name="Submit3" value=""></td>

</tr>

</table>

</form>

. , :

<form name="form1" method="post" action="FacultyAdd"> - , , method : post get; action , .

<input type="text" name="facultyName> - , .

<input type="submit" name="Submit" value=""> - , , action .

<input type="reset" name="Submit3" value=""> - , .

2.4.1.1 2.4.1.2 / .

2.4.1.1 - /

2.4.1.2 - /

, .


2.4.2

. 2.4 . , .

(Faculty), Faculty. :

public class Faculty

, Faculty, .. facultyID, facultyName, facultyShortName. , :

private int facultyID;

private String facultyName;

private String facultyShortName;

- , , .. public. , , .

facultyID, :

public int getFacultyID() {

return facultyID;

}

facultyID, setFacultyID:

public void setFacultyID(int facultyID) {

this.facultyID = facultyID;

}

, . , .. , , , . :

public Faculty(int facultyID, String facultyName, String facultyShortName) {

this.facultyID=facultyID;

this.facultyName=facultyName;

this.facultyShortName=facultyShortName;

}

, , , .

Faculty .

2.4.3

. , . , , , .

: . , , , SQL SELECT. , , INSERT, UPDATE, DELETE [10].

, , PreparedStatement. , Faculty.

:

sqlGetAllFaculty=connection.prepareStatement("SELECT * FROM Faculty ORDER BY facultyName");

sqlInsert=connection.prepareStatement("INSERT INTO Faculty (facultyName, facultyShortName) VALUES (?, ?)");

sqlUpdate=connection.prepareStatement("UPDATE Faculty SET facultyName=?, facultyShortName=? WHERE facultyID=?");

sqlDelete=connection.prepareStatement("DELETE FROM Faculty WHERE facultyID=?");

sqlGetRecord=connection.prepareStatement("SELECT * FROM Faculty WHERE facultyID=?");

sqlFindByName=connection.prepareStatement("SELECT * FROM Faculty WHERE facultyName=?");

? , . setxxx(< >, <>). 1 .

, :

public void Insert(Faculty rec) throws SQLException{

sqlInsert.setString(1, rec.getFacultyName());

sqlInsert.setString(2, rec.getFacultyShortName());

sqlInsert.executeUpdate();

}

, , , INSERT, UPDATE, DELETE, executeUpdate(). , SELECT, executeQuery().

, , :

public boolean isRecord(String recName) throws SQLException {

sqlFindByName.setString(1, recName);

ResultSet rs=sqlFindByName.executeQuery();

if(!rs.next()) return false;

return true;

}

.

2.5

 

2.5.1

. . ( 2.5.1.1).

2.5.1.1

, , , ( 2.5.1.2).

2.5.1.2

, . installation, , , .

2.5.2

. , . 2.5.2.1. , , . , . 2.5.2.2.

2.5.2.1

, .

2.5.2.2

, . . . , . , , . , ( 2.5.2.3). , .

2.5.2.3

, . , . , 2.5.2.4. , . , , ( 2.5.2.5), .

2.5.2.4

2.5.2.5

, . . , , , 2.5.2.6. , ( 2.5.2.7).


2.5.2.6

2.5.2.7 ,

, , .. , . . , , , , . 2.5.2.8.

2.5.2.8

2.5.3

, . , 2.5.3.1.

, , , .

2.5.3.1 -

. . .

, , . , , 2.5.3.2, . , , . .

. , . .


2.5.3.2 -

. - , . 2.5.3.3 .

2.5.3.3 -

. . , 2.5.3.4 2.5.3.5 .


2.5.3.4 -

2.5.3.5

2.5.4

, . , , . .

, .

2.5.4.1 , .

2.5.4.1

. , , . , . 2.5.4.2.

2.5.4.2 -

. , 2.5.4.3.


, . , . . , . , .

, .. . Java , web-, . , Oracle Database 10g .

/ / Ļ, .

, . , , .

, . . , . , .

, , , .

, , , , .

, .


1 . Oracle . . . - .: ϻ, 2003. 672 .

2 ., . Oracle. . . . .: -, 2006. - 464., .

3 .. Java 2. .: -, 2005. 720.: .

4 .., .., .. . Java 2. . . .: -, 2003 . -560.: . .

5 http://www.pcmag.ru/library/detail.php?ID=9281

6 .., .. Oracle. /2- , . . .: , 2002 496 .

7 . . // .2005-03(52)-.32-35.

8 . . - 21 . : . . .: , 2002. 672 . : .

9 www.citforum.ru/internet/javascript/java_rbint.shtml.htm

10 .., .. . : ; .: һ, 2002. 504 . ( ).



 


() - ..

 

 

 

! , , , .
. , :