교육2 ? 그림

Similar documents
Interstage5 SOAP서비스 설정 가이드

No Slide Title

Interstage4 설치가이드

Intro to Servlet, EJB, JSP, WS

歯Writing_Enterprise_Applications_2_JunoYoon.PDF

rmi_박준용_final.PDF

PowerPoint 프레젠테이션

02 C h a p t e r Java

Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Cras

목차 JEUS EJB Session Bean가이드 stateful session bean stateful sample 가이드 sample source 결과확인 http session에

ORANGE FOR ORACLE V4.0 INSTALLATION GUIDE (Online Upgrade) ORANGE CONFIGURATION ADMIN O

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET

untitled

I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r

JMF3_심빈구.PDF

JMF2_심빈구.PDF

J2EE & Web Services iSeminar

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

10.ppt

PowerPoint 프레젠테이션

1

Mobile Service > IAP > Android SDK [ ] IAP SDK TOAST SDK. IAP SDK. Android Studio IDE Android SDK Version (API Level 10). Name Reference V

MasoJava4_Dongbin.PDF

JavaGeneralProgramming.PDF

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D D382E687770>

Chap12

FileMaker 15 ODBC 및 JDBC 설명서

CD-RW_Advanced.PDF

FileMaker ODBC 및 JDBC 가이드

Dialog Box 실행파일을 Web에 포함시키는 방법

Interstage

chapter1,2.doc

자바-11장N'1-502

ODS-FM1

DocsPin_Korean.pages

MPLAB C18 C

thesis

Remote UI Guide

APOGEE Insight_KR_Base_3P11

J2EE Concepts

Microsoft PowerPoint - Smart CRM v4.0_TM 소개_ pptx

歯Writing_Enterprise_Applications_7_JunoYoon.PDF

Chap7.PDF

PowerPoint 프레젠테이션

Eclipse 와 Firefox 를이용한 Javascript 개발 발표자 : 문경대 11 년 10 월 26 일수요일

비긴쿡-자바 00앞부속

NoSQL

@OneToOne(cascade = = "addr_id") private Addr addr; public Emp(String ename, Addr addr) { this.ename = ename; this.a

신림프로그래머_클린코드.key

10X56_NWG_KOR.indd

untitled

초보자를 위한 ADO 21일 완성

ecorp-프로젝트제안서작성실무(양식3)

untitled

FileMaker ODBC and JDBC Guide

12-file.key

KYO_SCCD.PDF

User's Guide Manual

소개 TeraStation 을 구입해 주셔서 감사합니다! 이 사용 설명서는 TeraStation 구성 정보를 제공합니다. 제품은 계속 업데이트되므로, 이 설명서의 이미지 및 텍스트는 사용자가 보유 중인 TeraStation 에 표시 된 이미지 및 텍스트와 약간 다를 수

chapter4

iii. Design Tab 을 Click 하여 WindowBuilder 가자동으로생성한 GUI 프로그래밍환경을확인한다.

Spring Boot/JDBC JdbcTemplate/CRUD 예제

( )부록

07 자바의 다양한 클래스.key

ilist.add(new Integer(1))과 같이 사용하지 않고 ilist.add(1)과 같이 사용한 것은 자바 5.0에 추가된 기본 자료형과 해당 객체 자료 형과의 오토박싱/언박싱 기능을 사용한 것으로 오토박싱이란 자바 컴파일러가 객체를 요구하는 곳에 기본 자료형

05-class.key

thesis

ch09

untitled

Assign an IP Address and Access the Video Stream - Installation Guide

DE1-SoC Board

Modern Javascript

Spring Data JPA Many To Many 양방향 관계 예제

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for

Domino Designer Portal Development tools Rational Application Developer WebSphere Portlet Factory Workplace Designer Workplace Forms Designer

6주차.key

C# Programming Guide - Types

초보자를 위한 자바 2 21일 완성 - 최신개정판

Secure Programming Lecture1 : Introduction

Sena Device Server Serial/IP TM Version

09-interface.key

5장.key

Orcad Capture 9.x

PRO1_09E [읽기 전용]

FileMaker ODBC and JDBC Guide

,,,,,, (41) ( e f f e c t ), ( c u r r e n t ) ( p o t e n t i a l difference),, ( r e s i s t a n c e ) 2,,,,,,,, (41), (42) (42) ( 41) (Ohm s law),

No Slide Title

Network Programming

13주-14주proc.PDF

final_thesis

untitled

Solaris Express Developer Edition

강의10

Copyright 2012, Oracle and/or its affiliates. All rights reserved.,.,,,,,,,,,,,,.,...,. U.S. GOVERNMENT END USERS. Oracle programs, including any oper


초보자를 위한 ASP.NET 2.0

ETL_project_best_practice1.ppt

Corporate PPT Template

Apache2 + Tomcat 5 + JK2 를 사용한 로드밸런싱과 세션 복제 클러스터링 사이트 구축

Transcription:

Interstage 5 Apworks EJB Application Internet Revision History Edition Date Author Reviewed by Remarks 1 2002/10/11 2 2003/05/19 3 2003/06/18 EJB 4 2003/09/25 Apworks5.1

[ Stateless Session Bean ] ApworksJava, Web Application EJB. EJB, EJB Interstage Deploy. Session Bean ( Stateless Bean ) Deployment Tool Deploy EJB Test. - Interstage Application Server Plus Developer V5.0.1 WAS Interstage Application Server Apworks. PC, EJB Application Remote Deploy. PC O/S. No. Operating System Name Version, level 1 Windows NT(R) Server 4.0(*1) 2 Windows NT(R) Server, Enterprise Edition 4.0(*1) 3 Windows(R) 2000 Server - 4 Windows(R) 2000 Advanced Server - 5 Windows(R) 2000 Professional - 6 Windows(R) XP Professional - Fujitsu Eclipse Board Member Apworks Eclipse.

< Stateless Session Bean > APWORKS.( [ ] [ ] [Interstage Plus] [Apworks] [Apworks]) 1. [ ] [ ] [ ] -> Enterprise JavaBeans Project

2.. ( HelloEJB ) (. ) 3.. Java Library [ ].

4. Code Geneation. [ ]. 5. EJB, Package EJB.( : packagehelloejb EJB : HelloEJB )

6. Transaction Management Type. ( Container ) 7. ejbcreate()..

8.. Business. Business ( add hello().) *) Return Type.

9.. HelloEJBHome.java : HelloEJBRemote.java : Remote HelloEJB.java : EJB ejb-jar.xml : ejb 10. HelloEJB.java. * EJB (ejb-jar.xml) LANG. (1) JNDI import import javax.naming.*;. (2) hello().. public String hello() { } System.out.println("hello Method called ========="); try { Context ic = new InitialContext(); String lang = (String)ic.lookup("java:comp/env/LANG"); if (lang.equalsignorecase("korean")) { return "? EJB"; } else if (lang.equalsignorecase("english")) { return "Hello EJB"; } } catch (Exception e) { } return "???? EJB!!";

11. ejb-jar.xml Bean. Apworks Tree ejb-jar.xml. HelloBean Environment Property Tab LANG KOREAN Setting. *Property Name : LANG *Type : java.lang.string *Value : KOREAN 12. Build. * [ ] [ ] ( F7 ) HelloEJB.jar. BuildjarWAS Deploy. InterstageJ2EE Management Tool EJB Deployment Wizard InterstageDeploy 2.

< Client > Apworks Interstage Interstage Client Package 2. (1) hosts Interstage Server IP. Windows2000 : c:winnt/system32/drivers/etc/hosts Windows95/98: c:windows/hosts ( ). 203.248.112.37 hostname (2) C:INTERSTAGEODWINetcINITHOST. hostname 8002 < Bean 1 : J2EE Management Tool > 1. [ ] [ ] [Interstage Operation Tool]. Interstage IP host. (12000) 2. O/S.

3. J2EE Management Tool. 4. EJBDeployIJServer [Deploy/UnDeploy]. MyServer IJServerEJBDeploy.

5. EJB jar Deploy. ( Deploy Start ) HelloEJB.

< Bean 2 : J2EE Management Tool > 1. [ ] [ ] - [EJB Deployment Wizard]. Next >. 2. DeployEJB, Next>. EJB SOAP Service Application SOAP.

3. Server fileclient Deploy. [ Server ] EJB Application. EJB ContainerDeploy. C:INTERSTAGEJ2EEvardeploymentdeployedejb [ Client ] EJB Client Stub. Test Application. C:INTERSTAGEJ2EEvardeploymentdeployeddistribute 4. Deployment.

5. Remote Install Deploy. (1) Interstage ServerInstall. - C:INTERSTAGEJ2EEvardeploymentdeployedejbHelloEJB Interstage install.shinstall.bat. (2) 3 Remote Install Remote. Option. (: -s [ IJServer] ) administrator Install. ( Solairs root) < : IJServer. > 5. InstallEJB Application. # ejbinfoapfolder -l path: C:InterstageJ2EEvardeploymentdeployedejbapp name type ssl CartBean EB/stateful OFF HelloEJB EB/stateless OFF total 2 EJB application(s) entried

< > 3., Interstage. 1. ejbdstarteb. 2. isstartwu. 3. J2EE Management Tool. 1. ejbdstarteb. ( # ejbstarteb s [IJServer] ) # ejbdstarteb -s MyServer 2.. # isstartwu MyServer 3. J2EE Management Tool. ( Start )

< Test Application > 1. [ ] [ ] [ ] -> Pure Java Project 2. ( : TestHelloEJB )

3.. 4. Interstage J2EE Library

5. Call EJB application from J2EE Application Client. 6. Add External Folders. C:INTERSTAGEJ2EEvardeploymentdeployeddistributeHelloEJBeb ) - orb.properties JDK jrelib. C:INTERSTAGEEJBetcorb.properties C:APWJBK3jdkjrelib. Orb.properties CORBA., ApworksEJB Test Client EJB.

7. EJB Test Client. 8., TestEJB jar.

9. Client type J2EE1.3. 10. TestHelloEJB.java [ ] -> [ ] -> [Java ].

< ( ) : EJB Access jsp application >, HelloEJB Bean jsp. <%@ page contenttype="text/html; charset=euc-kr" %> <%@ page import ="javax.ejb.*,java.io.*" %> <%@ page import ="javax.naming.*" %> <%@ page import ="javax.rmi.*" %> <%@ page import ="PackageHelloEJB.*" %> <% javax.naming.context ic = new javax.naming.initialcontext(); java.lang.object obj = (Object)ic.lookup("java:comp/env/ejb/HelloEJB"); HelloEJBHome home = (HelloEJBHome)javax.rmi.PortableRemoteObject.narrow(obj,HelloEJBHome.class); try{ HelloEJBRemote eb = home.create(); String strhello = eb.hello(); out.println("helloejb Bean' return String : " + strhello + " "); eb.remove(); }catch (java.rmi.remoteexception e) { e.printstacktrace(); }catch (javax.ejb.createexception e) { e.printstacktrace(); }catch(exception e){ } e.printstacktrace(); %> out.println("fighting");

[ Entity Bean ] < TestDB Table > Sample Table. Schema Table Column SCOTT MEMBER NAME ID AGE SALARY Table DB Script [Apworks etccreateoracle.sql. ======================================== CREATE TABLE MEMBER ( NAME CHAR(20), ID NUMBER(5), AGE NUMBER(2), SALARY NUMBER(6), PRIMARY KEY(ID) ) ======================================== The sections below explain how to create an entity bean, with an emphasis on special features of entity beans.

< Entity Bean > 1. [File]>[New]>[Project] Enterprise JavaBeans Project. 2.. ( EntityBean )

3.. Java Library [ ].. Oracle JDBC Entity Bean.

4. [Finish] 5. Bean TypeEJB. BMP

6. Entity Bean Data Source Name. ( : ORACLE )

7. Persistence Field. Add, DB Browse DB. DB.

Table. Persistence field,.

8. EjbCreate. [Next] 9. Finder Method. Add finder.

ejbfindbyage java.util.enumeration short age WHERE @AGE >=?age? ejbfindbysalary java.util.collection long salary WHERE >=?salary? @SALARY EJB Collection. 10. ejbfindbyage method. OK. Note WHERE @, "?". ejbfindbysalary.

. [Next]

File name ejb-jar.xml MemberBmp.java MemberBmpHome.java MemberBmpRemote.java MemberBmpRecord.java MemberBmpPrimaryKey.java Description deployment descriptor file Enterprise bean source Home interface source Remote interface source Record class containing all persistence fields Primary key class

13. ejb-jar.xml.. entity bean session bean, Client Application transaction [Required]. 14.. ( Session Bean ) 15. EJB Deploy. ( Session Bean ) JNDI Data Resource Interstage.

[ Entity Bean ] 1. [File]>[New]>[Project] Pure Java Project. 2.

3.. 4. Interstage J2EE Library

5. Call EJB application from J2EE Application Client. 6. Add External Folders EntityBean.jar. ) - orb.properties JDK jrelib. C:INTERSTAGEEJBetcorb.properties C:APWJBK3jdkjrelib. Orb.properties CORBA., ApworksEJB Test Client EJB.

7. EJB Test Client. 8., TestEJB jar.

9. Client type J2EE1.3. Modify the run method processing for EntityTest.java. package sample; /** * @author * * To change this generated comment, edit the template variable "typecomment": * Window>Preferences>Java>Templates. * To enable and disable the creation of type comments go to * Window>Preferences>Java>Code Generation. */ public class EntityTest { public static boolean bdump; /** * run. * @param args */

public void run(java.lang.string[] args) { // To output operation result to the file, delete the comment marks. // try { // System.setOut(new java.io.printstream( // new java.io.fileoutputstream("log.txt"))); // } // catch (java.io.filenotfoundexception ex) { // ex.printstacktrace(); // System.exit(1); // } // When the operation result is unnecessary, false is set. bdump = true; MemberBmpClient eb1 = new MemberBmpClient(); MemberBmpRecord record = new MemberBmpRecord(); record.name = "Taro Fujitsu"; record.id = 4; record.age = 31; record.salary = 500; eb1.create(record); eb1.findbyage((short)20); eb1.getrecord(); while(eb1.nextelement()!= null) { eb1.getrecord(); } } eb1.findbysalary((long)300); eb1.getrecord(); while(eb1.nextelement()!= null) { eb1.getrecord(); } /** * main. * @param args */ public static void main(java.lang.string[] args) { System.setProperty( "com.fujitsu.interstage.j2ee.deploymentdescriptorclient", "C:APWeclipseworkspaceEntityTestsrcMETA- INFapplication-client.xml"); // System.setProperty("java.naming.factory.initial", // "com.fujitsu.interstage.ejb.jndi.fjcnctxfactoryforclient"); System.setProperty( "java.naming.factory.initial", "com.fujitsu.interstage.j2ee.jndi.initialcontextfactoryforclient"); EntityTest object = new EntityTest(); object.run(args);

} /** * dump. * @param s */ public static void dump(string s) { if (bdump) { System.out.println(s); } } /** * dump. * @param s * @param obj */ public static void dump(string s, Object obj) { if (bdump) { if (obj instanceof sample.memberbmpremote) { sample.memberbmpremote data = (sample.memberbmpremote) obj; EntityTest.dump(s + "{"); EntityTest.dump(" }"); } else if (obj instanceof sample.memberbmprecord) { sample.memberbmprecord data = (sample.memberbmprecord) obj; EntityTest.dump(s + "{"); EntityTest.dump(" NAME=" + data.name); EntityTest.dump(" ID=" + data.id); EntityTest.dump(" AGE=" + data.age); EntityTest.dump(" SALARY=" + data.salary); EntityTest.dump(" }"); } else if (obj instanceof sample.memberbmpprimarykey) { sample.memberbmpprimarykey data = (sample.memberbmpprimarykey) obj; EntityTest.dump(s + "{"); EntityTest.dump(" ID=" + data.id); EntityTest.dump(" }"); } else if (obj instanceof java.util.enumeration) { java.util.enumeration data = (java.util.enumeration) obj; EntityTest.dump(s + "{"); EntityTest.dump(" }"); } else if (obj instanceof java.util.collection) { java.util.collection data = (java.util.collection) obj; EntityTest.dump(s + "{"); EntityTest.dump(" }"); } }

} } 11. Test Client,.