entr_jvbeans6_app.pdf

Size: px
Start display at page:

Download "entr_jvbeans6_app.pdf"

Transcription

1 V 5 EJB EJB JBoss Community EJB LGPL JDK Java Development Kit Apache Maven Git Eclipse IDE m2eclipse Eclipse IntelliJ IDEA

2 Subversion SCM $> git clone git://github.com/jbossejb3/oreilly-ejb-6thedition-book-examples.git $> git clone $> cd oreilly-ejb-6thedition-book-examples tags EJB Maven mylocation $> mvn clean install JBoss Nexus EJB POJO EJB EJB JUnit

3 JUnit JUnit JUnit API TestNG JBoss.org 2 ShrinkWrap ShrinkWrap Java JAR WAR EAR API Java Archives JAR Enterprise Archives EAR 1 Web ShrinkWrap API ZIP Exploded File URL ShrinkWrap JAR EAR ShrinkWrap EJB IDE ShrinkWrap EJB Arquillian EJB POJO

4 Arquillian Arquillian Arquillian Java Arquillian 2 JVM Arquillian Arquillian JVM Arquillian Java EE GlassFish JBoss AS GlassFish Tomcat Jetty Bean Wsld SE Arquillian Arquillian 1. / @Resource 4. / 5. Arquillian JUnit 4 TestNG 5 IDE Ant Maven Arquillian

5 5 A FirstEJB A.1 EJB EJB 2.x EJB 3.1 EJB POJO EJB EJB POJO A firstejb/ A.3 A.3.1 A CalculatorBeanBase.java package org.jboss.ejb3.examples.ch04.firstejb; import org.jboss.logging.logger; CalculatorEJB Bean

6 <a / public class CalculatorBeanBase implements CalculatorCommonBusiness // // // / private static final Logger log = Logger.getLogger(CalculatorBeanBase.class); // // org.jboss.ejb3.examples.ch04.firstejb.calculatorcommonbusiness#add(int[]) public int add(final int... arguments) // final StringBuffer sb = new StringBuffer(); sb.append("adding arguments: "); int result = 0; // for (final int arg : arguments) result += arg; sb.append(arg); sb.append(" "); // log.info(sb.tostring()); log.info("result: " + result); return result;

7 7 A CalculatorCommonBusiness.java package org.jboss.ejb3.examples.ch04.firstejb; <a / public interface CalculatorCommonBusiness // // // / int add(int... arguments); A CalculatorLocal.java package org.jboss.ejb3.examples.ch04.firstejb; import javax.ejb.ejblocalobject; CalculatorEJB EJB <a href="mailto:andrew.rubinger@jboss.org">alr</a> / public interface CalculatorLocal extends CalculatorCommonBusiness, EJBLocalObject A CalculatorLocalBusiness.java package org.jboss.ejb3.examples.ch04.firstejb; <a href="mailto:andrew.rubinger@jboss.org">alr</a>

8 8 / public interface CalculatorLocalBusiness extends CalculatorCommonBusiness A CalculatorLocalHome.java package org.jboss.ejb3.examples.ch04.firstejb; import javax.ejb.createexception; import javax.ejb.ejblocalhome; CalculatorEJB EJB <a href="mailto:andrew.rubinger@jboss.org">alr</a> / public interface CalculatorLocalHome extends EJBLocalHome // // create<method> // CalculatorEJB / CalculatorLocal create() throws CreateException; A CalculatorRemote.java package org.jboss.ejb3.examples.ch04.firstejb; import javax.ejb.ejbobject; CalculatorEJB EJB <a href="mailto:andrew.rubinger@jboss.org">alr</a> / public interface CalculatorRemote extends CalculatorCommonBusiness, EJBObject

9 9 A CalculatorRemoteBusiness.java package org.jboss.ejb3.examples.ch04.firstejb; <a / public interface CalculatorRemoteBusiness extends CalculatorCommonBusiness A CalculatorRemoteHome.java package org.jboss.ejb3.examples.ch04.firstejb; import java.rmi.remoteexception; import javax.ejb.createexception; import javax.ejb.ejbhome; CalculatorEJB EJB <a / public interface CalculatorRemoteHome extends EJBHome // // create<method> // CalculatorEJB / CalculatorRemote create() throws CreateException, RemoteException; A ManyViewCalculatorBean.java package org.jboss.ejb3.examples.ch04.firstejb; import javax.ejb.local; import javax.ejb.localbean; import javax.ejb.localhome; import javax.ejb.remote;

10 10 import javax.ejb.remotehome; import javax.ejb.stateless; EJB 3.1 CalculatorEJB // No-interface view public class ManyViewCalculatorBean extends CalculatorBeanBase implements CalculatorCommonBusiness / / A NoInterfaceViewCalculatorBean.java package org.jboss.ejb3.examples.ch04.firstejb; import javax.ejb.localbean; import javax.ejb.stateless; CalculatorEJB <a public class NoInterfaceViewCalculatorBean extends CalculatorBeanBase //

11 11 A SimpleCalculatorBean.java package org.jboss.ejb3.examples.ch04.firstejb; import javax.ejb.local; import javax.ejb.stateless; CalculatorEJB public class SimpleCalculatorBean extends CalculatorBeanBase implements CalculatorCommonBusiness / / A.3.2 A CalculatorAssertionDelegate.java package org.jboss.ejb3.examples.ch04.firstejb; import junit.framework.testcase; import <a href="mailto:andrew.rubinger@jboss.org">alr</a> / class CalculatorAssertionDelegate // // // /

12 12 private static final Logger log = Logger.getLogger(CalculatorAssertionDelegate.class); // // // Calculator / void assertadditionsucceeds(final CalculatorCommonBusiness calc) // final int[] arguments = new int[] 2, 3, 5; final int expectedsum = 10; // final int actualsum = calc.add(arguments); // TestCase.assertEquals(" ", expectedsum, actualsum); // final StringBuffer sb = new StringBuffer(); sb.append("obtained expected result, "); sb.append(actualsum); sb.append(", from arguments: "); for (final int arg : arguments) sb.append(arg); sb.append(" "); log.info(sb.tostring()); A CalculatorIntegrationTestCase.java package org.jboss.ejb3.examples.ch04.firstejb; import java.net.malformedurlexception; import javax.ejb.ejb; import org.jboss.arquillian.api.deployment; import org.jboss.arquillian.junit.arquillian;

13 13 import org.jboss.logging.logger; import org.jboss.shrinkwrap.api.shrinkwrap; import org.jboss.shrinkwrap.api.spec.javaarchive; import org.junit.beforeclass; import org.junit.test; import org.junit.runner.runwith; 1 <a href="mailto:andrew.rubinger@jboss.org">alr</a> public class CalculatorIntegrationTestCase // // // / private static final Logger log = Logger.getLogger(CalculatorIntegrationTestCase.class); CalculatorEJB EJB 3.x private static CalculatorLocalBusiness calclocalbusiness; Calculator / private static CalculatorAssertionDelegate assertiondelegate; public static JavaArchive createdeployment() throws MalformedURLException final JavaArchive archive = ShrinkWrap.create("firstejb.jar", JavaArchive.class). addpackage(calculatorbeanbase.class.getpackage()); log.info(archive.tostring(true)); return archive;

14 14 // // // public static void beforeclass() throws Throwable // assertiondelegate = new CalculatorAssertionDelegate(); // // // EJB 3.x CalculatorEJB public void testadditionusingbusinessreference() throws Throwable // log.info("testing EJB via business reference..."); assertiondelegate.assertadditionsucceeds(calclocalbusiness); A CalculatorUnitTestCase.java package org.jboss.ejb3.examples.ch04.firstejb; import junit.framework.testcase; import org.jboss.logging.logger; import org.junit.beforeclass; import org.junit.test; CalculatorEJB

15 <a / public class CalculatorUnitTestCase // // // / private static final Logger log = Logger.getLogger(CalculatorUnitTestCase.class); POJO / private static CalculatorCommonBusiness calc; // // // public static void beforeclass() // CalculatorCommonBusiness // POJO calc = new SimpleCalculatorBean(); // // // CalculatorEJB POJO public void testaddition() // final int[] arguments = new int[] 3, 7, 2; final int expectedsum = 12;

16 16 // final int actualsum = calc.add(arguments); // TestCase.assertEquals(" ", expectedsum, actualsum); // final StringBuffer sb = new StringBuffer(); sb.append("obtained expected result, "); sb.append(actualsum); sb.append(", from arguments: "); for (final int arg : arguments) sb.append(arg); sb.append(" "); log.info(sb.tostring()); A MultiViewCalculatorIntegrationTestCase.java package org.jboss.ejb3.examples.ch04.firstejb; import java.net.malformedurlexception; import javax.naming.context; import javax.naming.initialcontext; import org.jboss.arquillian.api.deployment; import org.jboss.arquillian.junit.arquillian; import org.jboss.logging.logger; import org.jboss.shrinkwrap.api.shrinkwrap; import org.jboss.shrinkwrap.api.spec.javaarchive; import org.junit.beforeclass; import org.junit.test; import org.junit.runner.runwith; <a href="mailto:andrew.rubinger@jboss.org">alr</a> public class MultiViewCalculatorIntegrationTestCase //

17 17 // // / private static final Logger log = Logger.getLogger(MultiViewCalculatorIntegrationTestCase.class); JNDI / private static Context namingcontext; CalculatorEJB EJB 3.x / private static CalculatorLocalBusiness calclocalbusiness; CalculatorEJB EJB 2.x / private static CalculatorLocal calclocal; Calculator / private static CalculatorAssertionDelegate assertiondelegate; JNDI / // JNDI private static final String JNDI_NAME_CALC_LOCAL_BUSINESS = ManyViewCalculatorBean.class. getsimplename() + "Local"; JNDI / // JNDI private static final String JNDI_NAME_CALC_REMOTE_HOME = ManyViewCalculatorBean.class. getsimplename() + "LocalHome";

18 18 public static JavaArchive createdeployment() throws MalformedURLException final JavaArchive archive = ShrinkWrap.create("firstejb.jar", JavaArchive.class).addPackage( CalculatorBeanBase.class.getPackage()); log.info(archive.tostring(true)); return archive; // // // public static void beforeclass() throws Throwable // CP jndi.properties namingcontext = new InitialContext(); // EJB 3.x calclocalbusiness = (CalculatorLocalBusiness) namingcontext.lookup(jndi_name_calc_local_business); // assertiondelegate = new CalculatorAssertionDelegate(); // EJB 2.x final Object calclocalhomereference = namingcontext.lookup(jndi_name_calc_remote_home); final CalculatorLocalHome calcremotehome = (CalculatorLocalHome) calclocalhomereference; calclocal = calcremotehome.create(); // // // EJB 3.x CalculatorEJB public void testadditionusingbusinessreference() throws Throwable //

19 19 log.info("testing remote business reference..."); assertiondelegate.assertadditionsucceeds(calclocalbusiness); EJB 2.x CalculatorEJB public void testadditionusingcomponentreference() throws Throwable // log.info("testing remote component reference..."); assertiondelegate.assertadditionsucceeds(calclocal); A jndi.properties # OpenEJB JNDI java.naming.factory.initial=org.apache.openejb.client.localinitialcontextfactory

20

21 21 B EJB B.1 Bean SLSB / SLSB XML B encryption/ B.3 B.3.1 B EncryptionBean.java package org.jboss.ejb3.examples.ch05.encryption; import java.io.unsupportedencodingexception; import java.security.messagedigest; import java.security.nosuchalgorithmexception; import java.security.spec.algorithmparameterspec; import java.security.spec.keyspec; import javax.annotation.postconstruct;

22 22 import javax.annotation.resource; import javax.crypto.cipher; import javax.crypto.secretkey; import javax.crypto.secretkeyfactory; import javax.crypto.spec.pbekeyspec; import javax.crypto.spec.pbeparameterspec; import javax.ejb.local; import javax.ejb.remote; import javax.ejb.sessioncontext; import javax.ejb.stateless; import org.apache.commons.codec.binary.base64; import org.jboss.logging.logger; EncryptionEJB <a href="mailto:alr@jboss.org">alr</a> public class EncryptionBean implements EncryptionLocalBusiness, EncryptionRemote Business // // // / private static final Logger log = Logger.getLogger(EncryptionBean.class); EJB META-INF/ejb-jar.xml / static final String EJB_NAME = "EncryptionEJB"; ejb-jar.xml

23 23 / private static final String ENV_ENTRY_NAME_CIPHERS_PASSPHRASE = "cipherspassphrase"; ejb-jar.xml / private static final String ENV_ENTRY_NAME_MESSAGE_DIGEST_ALGORITHM = "messagedigestalgorithm"; / private static final String DEFAULT_ALGORITHM_MESSAGE_DIGEST = "MD5"; / / private static final String CHARSET = "UTF-8"; / private static final String DEFAULT_ALGORITHM_CIPHER = "PBEWithMD5AndDES"; / / private static final String DEFAULT_PASSPHRASE = "LocalTestingPassphrase"; / / private static final byte[] DEFAULT_SALT_CIPHERS = (byte) 0xB4, (byte) 0xA2, (byte) 0x43, (byte) 0x89, 0x3E, (byte) 0xC5, (byte)0x78, (byte) 0x53; / / private static final int DEFAULT_ITERATION_COUNT_CIPHERS = 20; // // // /

24 24 API / EJB EJB private SessionContext context; SessionContext.lookup / private String cipherspassphrase; env-entry = ENV_ENTRY_NAME_MESSAGE_DIGEST_ALGORITHM) private String messagedigestalgorithm; / private MessageDigest messagedigest; / private Cipher encryptioncipher; / private Cipher decryptioncipher; // // //

25 Exception public void initialize() throws Exception // log.info(" " + PostConstruct.class.getName() + " "); / / // final String cipheralgorithm = DEFAULT_ALGORITHM_CIPHER; final byte[] cipherssalt = DEFAULT_SALT_CIPHERS; final int ciphersiterationcount = DEFAULT_ITERATION_COUNT_CIPHERS; final String cipherspassphrase = this.getcipherspassphrase(); // final KeySpec cipherskeyspec = new PBEKeySpec(ciphersPassphrase.toCharArray(), cipherssalt, ciphersiterationcount); final SecretKey cipherskey = SecretKeyFactory.getInstance(cipherAlgorithm). generatesecret(cipherskeyspec); final AlgorithmParameterSpec paramspec = new PBEParameterSpec(ciphersSalt, ciphersiterationcount); // this.encryptioncipher = Cipher.getInstance(ciphersKey.getAlgorithm()); this.decryptioncipher = Cipher.getInstance(ciphersKey.getAlgorithm()); encryptioncipher.init(cipher.encrypt_mode, cipherskey, paramspec); decryptioncipher.init(cipher.decrypt_mode, cipherskey, paramspec); // log.info("initialized encryption cipher: " + this.encryptioncipher); log.info("initialized decryption cipher: " + this.decryptioncipher); / / // final String messagedigestalgorithm = this.getmessagedigestalgorithm(); // try

26 26 this.messagedigest = MessageDigest.getInstance(messageDigestAlgorithm); catch (NoSuchAlgorithmException e) throw new RuntimeException("Could not obtain the " + MessageDigest.class.getSimpleName() + " for algorithm: " + messagedigestalgorithm, e); log.info("initialized MessageDigest for one-way hashing: " + this.messagedigest); // // org.jboss.ejb3.examples.ch05.encryption.encryptioncommonbusiness#compare(java.lang.string, java.lang.string) public boolean compare(final String hash, final String input) throws IllegalArgumentException, EncryptionException // if (hash == null) throw new IllegalArgumentException("hash is required."); if (input == null) throw new IllegalArgumentException("Input is required."); // final String hashofinput = this.hash(input); // final boolean equal = hash.equals(hashofinput); // return

27 org.jboss.ejb3.examples.ch05.encryption.encryptioncommonbusiness#decrypt(java.lang.string) public String decrypt(final String input) throws IllegalArgumentException, IllegalStateException, EncryptionException // final Cipher cipher = this.decryptioncipher; if (cipher == null) throw new IllegalStateException("Decryption cipher not available, has this service been initialized?"); // byte[] resultbytes = null;; try final byte[] inputbytes = this.stringtobytearray(input); resultbytes = cipher.dofinal(base64.decodebase64(inputbytes)); catch (final Throwable t) throw new EncryptionException("Error in decryption", t); final String result = this.bytearraytostring(resultbytes); // log.info("decryption on "" + input + " ": " + result); // org.jboss.ejb3.examples.ch05.encryption.encryptioncommonbusiness#encrypt(java.lang.string) public String encrypt(final String input) throws IllegalArgumentException, EncryptionException // final Cipher cipher = this.encryptioncipher; if (cipher == null) throw new IllegalStateException("Encryption cipher not available, has this service been initialized?");

28 28 // byte[] inputbytes = this.stringtobytearray(input); // byte[] resultbytes = null; try resultbytes = Base64.encodeBase64(cipher.doFinal(inputBytes)); catch (final Throwable t) throw new EncryptionException("Error in encryption of: " + input, t); // log.info("encryption on "" + input + " ": " + this.bytearraytostring(resultbytes)); // final String result = this.bytearraytostring(resultbytes); return result; 1 2 N / / org.jboss.ejb3.examples.ch05.encryption.encryptioncommonbusiness#hash(java.lang.string) public String hash(final String input) throws IllegalArgumentException, EncryptionException // if (input == null) throw new IllegalArgumentException("Input is required."); //

29 29 byte[] inputbytes = this.stringtobytearray(input); // final MessageDigest digest = this.messagedigest; // digest.update(inputbytes, 0, inputbytes.length); final byte[] hashbytes = digest.digest(); final byte[] encodedbytes = Base64.encodeBase64(hashBytes); // final String hash = this.bytearraytostring(encodedbytes); log.info("one-way hash of "" + input + " ": " + hash); // return hash; env-entry org.jboss.ejb3.examples.ch05.encryption.encryptionbeanbase#getcipherspassphrase() public String getcipherspassphrase() // String passphrase = this.cipherspassphrase; // if (passphrase == null) // SessionContext passphrase = this.getenvironmententryasstring(env_entry_name_ciphers_passphrase);

30 30 // if (passphrase == null) // log.warn("no encryption passphrase has been supplied explicitly via " + "an env-entry, falling back on the default..."); // passphrase = DEFAULT_PASSPHRASE; // this.cipherspassphrase = passphrase; // log.info("using encryption passphrase for ciphers keys: " + passphrase); // return passphrase; ejb-jar.xml org.jboss.ejb3.examples.ch05.encryption.encryptionremotebusiness#getmessagedigestalgorithm() public String getmessagedigestalgorithm() // / if (this.messagedigestalgorithm == null) // log.warn("no message digest algorithm has been supplied explicitly via " + "an env-entry, falling back on the default..."); // this.messagedigestalgorithm = DEFAULT_ALGORITHM_MESSAGE_DIGEST; //

31 31 log.info("configured MessageDigest one-way hash algorithm is: " + this.messagedigestalgorithm); // return this.messagedigestalgorithm; // // // IllegalStateException enventryname IllegalStateException / private String getenvironmententryasstring(final String enventryname) throws IllegalStateException // SessionContext final SessionContext context = this.context; if (context == null) log.warn("no SessionContext, bypassing request to obtain environment entry: " + enventryname); return null; // SessionContext JNDI ENC Object lookupvalue = null; try lookupvalue = context.lookup(enventryname); log.debug(" " + enventryname + " " + lookupvalue); catch (final IllegalArgumentException iae) // EJB // null log.warn(" " + enventryname); return null;

32 32 // String returnvalue = null; try returnvalue = String.class.cast(lookupValue); catch (final ClassCastException cce) throw new IllegalStateException(" " + lookupvalue + " " + String.class.getName() + " ", cce); // return @throws IllegalArgumentException / private String bytearraytostring(final byte[] bytes) throws RuntimeException, IllegalArgumentException // if (bytes == null) throw new IllegalArgumentException("Byte array is required."); // String result = null; final String charset = this.getcharset(); try result = new String(bytes, charset); catch (final UnsupportedEncodingException e)

33 33 throw new RuntimeException("Specified charset is invalid: " + charset, e); // return @throws IllegalArgumentException null / private byte[] stringtobytearray(final String input) throws RuntimeException, IllegalArgumentException // if (input == null) throw new IllegalArgumentException("Input is required."); // byte[] result = null; final String charset = this.getcharset(); try result = input.getbytes(charset); catch (final UnsupportedEncodingException e) throw new RuntimeException("Specified charset is invalid: " + charset, e); // return result; /

34 / private String getcharset() return CHARSET; B EncryptionCommonBusiness.java package org.jboss.ejb3.examples.ch05.encryption; <a href="mailto:alr@jboss.org">alr</a> / public interface EncryptionCommonBusiness // // // input IllegalArgumentException EncryptionException / String encrypt(string input) throws IllegalArgumentException, @throws IllegalArgumentException EncryptionException / String decrypt(string input) throws IllegalArgumentException, EncryptionException;

35 @throws IllegalArgumentException EncryptionException / String hash(string input) throws IllegalArgumentException, @throws IllegalArgumentException EncryptionException / boolean compare(string hash, String input) throws IllegalArgumentException, EncryptionException; / / / String /

36 36 String getmessagedigestalgorithm(); B EncryptionException.java package org.jboss.ejb3.examples.ch05.encryption; import <a // Exception // public class EncryptionException extends Exception // // // JVM / private static final long serialversionuid = 1L; // // // / / public EncryptionException() super(); public EncryptionException(String message, Throwable cause) super(message, cause);

37 37 public EncryptionException(String message) super(message); public EncryptionException(Throwable cause) super(cause); B EncryptionLocalBusiness.java package org.jboss.ejb3.examples.ch05.encryption; EncryptionEJB EJB <a / public interface EncryptionLocalBusiness extends EncryptionCommonBusiness // B EncryptionRemoteBusiness.java package org.jboss.ejb3.examples.ch05.encryption; EncryptionEJB EJB <a / public interface EncryptionRemoteBusiness extends EncryptionCommonBusiness // B META-INF/ejb-jar.xml <ejb-jar xmlns=" xmlns:xsi=" xsi:schemalocation=" version="3.1"> <enterprise-beans>

38 38 <!-- EncryptionEJB --> <session> <!-- --> <ejb-name>encryptionejb</ejb-name> <!-- --> <env-entry> <env-entry-name>cipherspassphrase</env-entry-name> <env-entry-type>java.lang.string</env-entry-type> <env-entry-value>overriddenpassword</env-entry-value> </env-entry> <!-- --> <env-entry> <env-entry-name>messagedigestalgorithm</env-entry-name> <env-entry-type>java.lang.string</env-entry-type> <env-entry-value>sha</env-entry-value> </env-entry> </session> </enterprise-beans> </ejb-jar> B.3.2 B EncryptionIntegrationTestCase.java package org.jboss.ejb3.examples.ch05.encryption; import java.net.malformedurlexception; import java.net.url; import javax.ejb.ejb; import junit.framework.testcase; import org.jboss.arquillian.api.deployment; import org.jboss.arquillian.junit.arquillian; import org.jboss.logging.logger; import org.jboss.shrinkwrap.api.shrinkwrap; import org.jboss.shrinkwrap.api.spec.javaarchive;

39 39 import org.junit.test; import org.junit.runner.runwith; <a public class EncryptionIntegrationTestCase extends EncryptionTestCaseSupport // // // / private static final Logger log = Logger.getLogger(EncryptionIntegrationTestCase.class); EncryptionEJB EJB 3.x private static EncryptionLocalBusiness encryptionlocalbusiness; ejb-jar.xml env-entry / private static final String EXPECTED_CIPHERS_PASSPHRASE = "OverriddenPassword"; ejb-jar.xml env-entry / private static final String EXPECTED_ALGORITHM_MESSAGE_DIGEST = "SHA"; public static JavaArchive createdeployment() throws MalformedURLException final JavaArchive archive = ShrinkWrap.create("slsb.jar", JavaArchive.class). addclasses(encryptionbean.class, EncryptionCommonBusiness.class, EncryptionLocalBusiness.class, EncryptionRemoteBusiness.class, EncryptionException.class).addManifestResource(new URL(Encryption IntegrationTestCase.class.getProtectionDomain().getCodeSource().getLocation(), "../classes/meta-

40 40 INF/ejb-jar.xml"), "ejb-jar.xml"); // SHRINKWRAP-141 ejb-jar log.info(archive.tostring(true)); return archive; // // // / EncryptionTestCaseSupport#assertHashing(EncryptionCommonBusiness) public void testhashing() throws Throwable // log.info("testhashing"); EncryptionTestCaseSupport#assertEncryption(EncryptionCommonBusiness) public void testencryption() throws Throwable // log.info("testencryption"); // this.assertencryption(encryptionlocalbusiness); Throwable /

41 public void testmessagedigestalgorithmoverride() throws Throwable // log.info("testmessagedigestalgorithmoverride"); // final String algorithm = encryptionlocalbusiness.getmessagedigestalgorithm(); log.info("using MessageDigest algorithm: " + algorithm); // TestCase.assertEquals("MessageDigest algorithm should have been overridden from the environment entry", EXPECTED_ALGORITHM_MESSAGE_DIGEST, algorithm); Throwable public void testcipherspassphraseoverride() throws Throwable // log.info("testcipherspassphraseoverride"); // final String passphrase = encryptionlocalbusiness.getcipherspassphrase(); log.info("using Encryption passphrase: " + passphrase); // TestCase.assertEquals("Encryption passphrase should have been overridden from the environment entry", EXPECTED_CIPHERS_PASSPHRASE, passphrase); B EncryptionTestCaseSupport.java package org.jboss.ejb3.examples.ch05.encryption; import junit.framework.testcase; import org.jboss.logging.logger; Encryption POJO EncryptionEJB

42 <a / public class EncryptionTestCaseSupport // // // / private static final Logger log = Logger.getLogger(EncryptionTestCaseSupport.class); / private static final String TEST_STRING = "EJB 3.1 Examples Test String"; // // // service POJO Throwable / protected void asserthashing(final EncryptionCommonBusiness service) throws Throwable // log.info("asserthashing"); // final String input = TEST_STRING; // final String hash = service.hash(input); log.info(" " + input + " " + hash); //

43 43 TestCase.assertNotSame("The hash function had no effect upon the supplied input", input, hash); // final boolean equal = service.compare(hash, input); // TestCase.assertTrue("The comparison of the input to its hashed result failed", equal); 1 POJO Throwable / protected void assertencryption(final EncryptionCommonBusiness service) throws Throwable // log.info("assertencryption"); // final String input = TEST_STRING; // final String encrypted = service.encrypt(input); log.info("encrypted result of "" + input + " ": " + encrypted); // TestCase.assertNotSame("The encryption function had no effect upon the supplied input", input, encrypted); // final String roundtrip = service.decrypt(encrypted); // TestCase.assertEquals("The comparison of the input to its encrypted result failed", input, roundtrip);

44 44 B EncryptionUnitTestCase.java package org.jboss.ejb3.examples.ch05.encryption; import org.jboss.logging.logger; import org.junit.beforeclass; import org.junit.test; <a / public class EncryptionUnitTestCase extends EncryptionTestCaseSupport // // // / private static final Logger log = Logger.getLogger(EncryptionUnitTestCase.class); POJO / private static EncryptionBean encryptionservice; // // // public static void initialize() throws Throwable // POJO encryptionservice = new EncryptionBean(); encryptionservice.initialize(); // //

45 45 // // / EncryptionTestCaseSupport#assertHashing(EncryptionCommonBusiness) public void testhashing() throws Throwable // log.info("testhashing"); EncryptionTestCaseSupport#assertEncryption(EncryptionCommonBusiness) public void testencryption() throws Throwable // log.info("testencryption"); // this.assertencryption(encryptionservice);

46

47 47 C EJB FTP C.1 FTP Bean FTP RAM SFSB / C filetransfer/ C.3 C.3.1 C FileTransferBean.java package org.jboss.ejb3.examples.ch06.filetransfer; import java.io.ioexception; import java.io.serializable; import javax.annotation.postconstruct; import javax.annotation.predestroy;

48 48 import javax.ejb.postactivate; import javax.ejb.prepassivate; import javax.ejb.remote; import javax.ejb.remove; import javax.ejb.stateful; import org.apache.commons.net.ftp.ftpclient; import org.apache.commons.net.ftp.ftpfile; import org.apache.commons.net.ftp.ftpreply; import org.jboss.logging.logger; Bean FileTransferEJB <a = public class FileTransferBean implements FileTransferRemoteBusiness, Serializable // UID / private static final long serialversionuid = 1L; / private static final Logger log = Logger.getLogger(FileTransferBean.class); JNDI EJB / public static final String EJB_NAME = "FileTransferEJB"; / private static String CONNECT_HOST = "localhost";

49 49 FTP IANA 21 nix / private static int CONNECT_PORT = 12345; // FTP / private FTPClient client; / private String presentworkingdirectory; // // org.jboss.ejb3.examples.ch06.filetransfer.filetransfercommonbusiness# @Override public void disconnect() // FTP final FTPClient client = this.getclient(); //

50 50 if (client!= null) // if (client.isconnected()) // try client.logout(); log.info("logged out of: " + client); catch (final IOException ioe) log.warn("exception encountered in logging out of the FTP client", ioe); // try log.debug("disconnecting: " + client); client.disconnect(); log.info("disconnected: " + client); catch (final IOException ioe) log.warn("exception encountered in disconnecting the FTP client", ioe); // null this.client = null; @Override public void connect() throws IllegalStateException, FileTransferException

51 51 / / final FTPClient clientbefore = this.getclient(); if (clientbefore!= null && clientbefore.isconnected()) throw new IllegalStateException("FTP "); // final String connecthost = this.getconnecthost(); final int connectport = this.getconnectport(); // final FTPClient client = new FTPClient(); final String canonicalservername = connecthost + ":" + connectport; log.debug("connecting to FTP Server at " + canonicalservername); try client.connect(connecthost, connectport); catch (final IOException ioe) throw new FileTransferException("Error in connecting to " + canonicalservername, ioe); // log.info("connected to FTP Server at: " + canonicalservername); this.setclient(client); // this.checklastoperation(); try // client.login("user", "password"); // this.checklastoperation(); catch (final Exception e) throw new FileTransferException("Could not log in", e); // pwd cd

52 52 final String pwd = this.getpresentworkingdirectory(); if (pwd!= null) this.cd(pwd); // // // / org.jboss.ejb3.examples.ch06.filetransfer.filetransfercommonbusiness#cd(java.lang.string) public void cd(final String directory) // final FTPClient client = this.getclient(); // cd try // cd client.changeworkingdirectory(directory); e); // this.checklastoperation(); catch (final Exception e) throw new FileTransferException("Could not change working directory to "" + directory + " "", // pwd log.info("cd > " + directory); this.setpresentworkingdirectory(directory); / org.jboss.ejb3.examples.ch06.filetransfer.filetransfercommonbusiness#mkdir(java.lang.string) public void mkdir(final String directory)

53 53 // final FTPClient client = this.getclient(); // cd try // mkdir client.makedirectory(directory); // this.checklastoperation(); catch (final Exception e) throw new FileTransferException("Could not make directory "" + directory + " "", e); / org.jboss.ejb3.examples.ch06.filetransfer.filetransfercommonbusiness#pwd() public String pwd() // final FTPClient client = this.getclient(); // pwd try final FTPFile[] files = client.listfiles(); for (final FTPFile file : files) log.info(file); // pwd return client.printworkingdirectory(); catch (final IOException ioe) throw new FileTransferException("Could not print working directory", ioe);

54 54 // // FileTransferException / protected void checklastoperation() throws FileTransferException // final FTPClient client = this.getclient(); // final int connectreply = client.getreplycode(); if (!FTPReply.isPositiveCompletion(connectReply)) // throw new FileTransferException("Did not receive positive completion code from server, instead code was: " + connectreply); / public void endsession() log.info("session Ending..."); // / connecthost / public String getconnecthost() return CONNECT_HOST;

55 connectport / public int getconnectport() return client / protected final FTPClient getclient() return client / private void setclient(final FTPClient client) this.client = presentworkingdirectory / private String getpresentworkingdirectory() return presentworkingdirectory presentworkingdirectory / private void setpresentworkingdirectory(string presentworkingdirectory) this.presentworkingdirectory = presentworkingdirectory;

56 56 C FileTransferCommonBusiness.java package org.jboss.ejb3.examples.ch06.filetransfer; <a / public interface FileTransferCommonBusiness // // // IllegalStateException / void mkdir(string directory) throws IllegalStateException / void cd(string directory) IllegalStateException / String pwd() throws IllegalStateException; /

57 57 / void disconnect(); IllegalStateException / / void connect() throws IllegalStateException; C FileTransferException.java package <a href="mailto:andrew.rubinger@jboss.org">alr</a> / public class FileTransferException extends RuntimeException // private static final long serialversionuid = 1L; // public FileTransferException() super(); public FileTransferException(final String message, final Throwable cause) super(message, cause); public FileTransferException(final String message)

58 58 super(message); public FileTransferException(final Throwable cause) super(cause); C FileTransferRemoteBusiness.java package org.jboss.ejb3.examples.ch06.filetransfer; import javax.ejb.remove; FileTransferEJB <a / public interface FileTransferRemoteBusiness extends FileTransferCommonBusiness // // // javax.ejb.remove / void endsession(); C.3.2 C FileTransferIntegrationTestCase.java package org.jboss.ejb3.examples.ch06.filetransfer; import java.io.file; import javax.ejb.ejb; import javax.ejb.nosuchejbexception;

59 59 import junit.framework.testcase; import org.jboss.arquillian.api.deployment; import org.jboss.arquillian.junit.arquillian; import org.jboss.logging.logger; import org.jboss.shrinkwrap.api.shrinkwrap; import org.jboss.shrinkwrap.api.spec.javaarchive; import org.junit.after; import org.junit.afterclass; import org.junit.beforeclass; import org.junit.test; import org.junit.runner.runwith; FileTransferEJB EJB FileTransferTestCaseBase <a public class FileTransferIntegrationTestCase extends FileTransferTestCaseBase // / private static final Logger log = Logger.getLogger(FileTransferIntegrationTestCase.class); FTP / private static final String FTP_SERVER_USERS_CONFIG_FILENAME = "ftpusers.properties"; FTP / private static final int FTP_SERVER_BIND_PORT = 12345;

60 60 FTP / private static FtpServerPojo public static JavaArchive createdeployment() final JavaArchive archive = ShrinkWrap.create("ftpclient.jar", JavaArchive.class). addpackage(filetransferbean.class.getpackage()); log.info(archive.tostring(true)); return archive; // EJB private FileTransferRemoteBusiness client1; FTP private FileTransferRemoteBusiness client2; // // // FTP public static void startftpserver() throws Exception // final FtpServerPojo server = new FtpServerPojo();

61 61 // server.setusersconfigfilename(ftp_server_users_config_filename); server.setbindport(ftp_server_bind_port); // server.initializeserver(); server.startserver(); ftpserver = server; Exception public static void stopftpserver() throws Exception ftpserver.stopserver(); FTP SFSB public void endclientsessions() throws Exception // 1 try client1.endsession(); // catch (final NoSuchEJBException nsee) // // 2 try client2.endsession(); // catch (final NoSuchEJBException nsee)

62 62 // // Exception public void testsessionisolation() throws Exception // log.info("testsessionisolation"); // final FileTransferRemoteBusiness session1 = this.getclient(); // final FileTransferRemoteBusiness session2 = this.client2; // final String ftphome = getftphome().getabsolutepath(); session1.cd(ftphome); session2.cd(ftphome); // final String newdirsession1 = "newdirsession1"; final String newdirsession2 = "newdirsession2"; session1.mkdir(newdirsession1); session1.cd(newdirsession1); session2.mkdir(newdirsession2); session2.cd(newdirsession2); // final String pwdsession1 = session1.pwd(); final String pwdsession2 = session2.pwd(); // TestCase.assertEquals(" 1 pwd ", ftphome + File.separator + newdirsession1, pwdsession1); TestCase.assertEquals(" 2 pwd ", ftphome + File.separator + newdirsession2, pwdsession2);

63 63 // 2 1 FileTransferRemoteBusiness#endSession() Exception public void testsfsbremoval() throws Exception // log.info("testsfsbremoval"); // final FileTransferRemoteBusiness sfsb = this.getclient(); // final String ftphome = getftphome().getabsolutepath(); sfsb.cd(ftphome); // pwd final String pwdbefore = sfsb.pwd(); TestCase.assertEquals(" FTP ", // Bean sfsb.endsession(); // NoSuchEJBException boolean gotexpectedexception = false; try sfsb.pwd(); catch (final NoSuchEJBException nsee) gotexpectedexception = true; TestCase.assertTrue(" SFSB Bean ", gotexpectedexception);

64 64 // / org.jboss.ejb3.examples.ch06.filetransfer.filetransfertestcasebase#getclient() protected FileTransferRemoteBusiness getclient() return this.client1; C FileTransferTestCaseBase.java package org.jboss.ejb3.examples.ch06.filetransfer; import java.io.file; import junit.framework.testcase; import org.jboss.logging.logger; import org.junit.after; import org.junit.before; import <a href="mailto:andrew.rubinger@jboss.org">alr</a> / public abstract class FileTransferTestCaseBase // / private static final Logger log = Logger.getLogger(FileTransferTestCaseBase.class);

新・明解Java入門

新・明解Java入門 537,... 224,... 224,... 32, 35,... 188, 216, 312 -... 38 -... 38 --... 102 --... 103 -=... 111 -classpath... 379 '... 106, 474!... 57, 97!=... 56 "... 14, 476 %... 38 %=... 111 &... 240, 247 &&... 66,

More information

V8.1新規機能紹介記事

V8.1新規機能紹介記事 WebOTX V8.1 新規機能 EJB 3.0 WebOTX V8.1より Java EE 5(Java Platform, Enterprise Edition 5) に対応しました これによりいろいろな機能追加が行われていますが 特に大きな変更であるEJB 3.0 対応についてご紹介いたします なお WebOTX V7で対応したEJB 2.1についてもWebOTX V8.1で引き続き利用することが可能です

More information

Java演習(4) -- 変数と型 --

Java演習(4)   -- 変数と型 -- 50 20 20 5 (20, 20) O 50 100 150 200 250 300 350 x (reserved 50 100 y 50 20 20 5 (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; (reserved public class Blocks1 extends

More information

Gartner Day

Gartner Day J2EE 1 J2EE C AP 2 J2EE AP DD java *.class java *.class java *.class *.class DD EAR, WAR, JAR orionapplicationclient.xmweb.xmapplication.jar.xml orion- orion-ejb- ml Oracle Application Server 10g *.jsp

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション Java J2EE Spring Spring Dependency Injection AOP Java J2EE 2 4 Application Java Enterprise API 5 6 mod_jk2 AJP13 Coyote/JK2 Connector Session Apache2 Tomcat5-a AJP13 Coyote/JK2 Connector Session Tomcat5-b

More information

ユニット・テストの概要

ユニット・テストの概要 2004 12 ... 3... 3... 4... 5... 6... 6 JUnit... 6... 7 Apache Cactus... 7 HttpUnit/ServletUnit... 8 utplsql... 8 Clover... 8 Anthill Pro... 9... 10... 10... 10 SQL... 10 Java... 11... 11... 12... 12 setter

More information

ALG ppt

ALG ppt 2012 6 21 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2012/index.html 1 l l O(1) l l l 2 (123 ) l l l l () l H(k) = k mod n (k:, n: ) l l 3 4 public class MyHashtable

More information

untitled

untitled 2011 6 20 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2011/index.html tech.ac.jp/k1sakai/lecture/alg/2011/index.html html 1 O(1) O(1) 2 (123) () H(k) = k mod n

More information

コンテナでテストをまわせ! Java EE への自動テストの導入 1 小西高之 JBoss Technical Support Engineer Red Hat K.K.

コンテナでテストをまわせ! Java EE への自動テストの導入 1 小西高之 JBoss Technical Support Engineer Red Hat K.K. コンテナでテストをまわせ! Java EE への自動テストの導入 1 小西高之 JBoss Technical Support Engineer Red Hat K.K. コンテナでテストをまわせ! Twitter ハッシュタグ : #jt12_b202 小西高之 @leather_sole 2 とあるプロジェクトで... これからアプリケーションのテストを始める はい! まずはこのテストだ! 3

More information

Oracle Forms Services R6i

Oracle Forms Services R6i Creation Date: Jul 04, 2001 Last Update: Jul 31, 2001 Version: 1.0 0 0... 1 1...3 1.1... 3 1.2... 3 1.3... 3 2...4 2.1 C/S... 4 2.2 WEB... 5 2.3 WEB... 5 2.4 JAVABEAN... 6 3 JAVABEAN...7 3.1... 7 3.2 JDEVELOPER...

More information

Oracle9i JDeveloperによるWebサービスの構築

Oracle9i JDeveloperによるWebサービスの構築 Oracle9i JDeveloper Web Web Web Web Web Web EJB Web EJB Web Web Oracle9iAS Apache SOAP WSDL Web Web Web Oracle9i JDeveloper Java XML Web Web Web Web Simple Object Access Protocol SOAP :Web Web Services

More information

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1 Java (9) 1 Lesson 7 2008-05-20 Java System.out.println() 1 Java API 1 Java Java 1 GUI 2 Java 3 1.1 5 3 1.0 10.0, 1.0, 0.5 5.0, 3.0, 0.3 4.0, 1.0, 0.6 1 2 4 3, ( 2 3 2 1.2 Java (stream) 4 1 a 5 (End of

More information

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF pref : 2004/6/5 (11:8) pref : 2004/6/5 (11:8) pref : 2004/6/5 (11:8) 3 5 14 18 21 23 23 24 28 29 29 31 32 34 35 35 36 38 40 44 44 45 46 49 49 50 pref : 2004/6/5 (11:8) 50 51 52 54 55 56 57 58 59 60 61

More information

A B 1: Ex. MPICH-G2 C.f. NXProxy [Tanaka] 2:

A B 1: Ex. MPICH-G2 C.f. NXProxy [Tanaka] 2: Java Jojo ( ) ( ) A B 1: Ex. MPICH-G2 C.f. NXProxy [Tanaka] 2: Java Jojo Jojo (1) :Globus GRAM ssh rsh GRAM ssh GRAM A rsh B Jojo (2) ( ) Jojo Java VM JavaRMI (Sun) Horb(ETL) ( ) JPVM,mpiJava etc. Send,

More information

rmi.book

rmi.book BEA WebLogic Server WebLogic RMI BEA WebLogic Server 6.1 : 2002 6 24 Copyright 2002 BEA Systems, Inc. All Rights Reserved. BEA Systems, Inc. BEA BEA BEA FAR 52.227-19 Commercial Computer Software-Restricted

More information

WEBシステムのセキュリティ技術

WEBシステムのセキュリティ技術 EJB (Enterprise Java Beans) 棚橋沙弥香 テーマ選定の背景 現在携わっている Java 開発案件で EJB が使われておりますが 私自身が EJB を扱うのが初めてで知らない技術でしたので 勉強してみたいと思い 今回はこのテーマを選定しました 目次 EJBとは 1 EJBの利点 2 EJBの歴史 3 EJBの開発環境の作成 4 5 Enterprise Bean 6 非同期処理の実装

More information

JAVA H13 OISA JAVA 1

JAVA H13 OISA JAVA 1 JAVA H13 OISA JAVA 1 ...3 JAR...4 2.1... 4 2.2... 4...5 3.1... 5 3.2... 6...7 4.1... 7 4.2... 7 4.3... 10 4.4...11 4.5... 12 4.6... 13 4.7... 14 4.8... 15 4.9... 16...18 5.1... 18 5.2...19 2 Java Java

More information

AOP (Aspect Oriented Programming) AOP Java 3 AOP 4 AOP DI DI 5 AOP JoinPoint Advice Aspect Weaving JoinPoint JoinPoint PointCut 6 Advice Advice Around Advice Before Advice After Advice After Throwing Advice

More information

II 1 p.1 1 Servlet 1.1 Web Web WWW HTML CGI Common Gateway Interface Web HTML Web Web CGI CGI CGI Perl, PHP C JavaScript Web CGI HTML 1.2 Servlet Java

II 1 p.1 1 Servlet 1.1 Web Web WWW HTML CGI Common Gateway Interface Web HTML Web Web CGI CGI CGI Perl, PHP C JavaScript Web CGI HTML 1.2 Servlet Java II 1 p.1 1 Servlet 1.1 Web Web WWW HTML CGI Common Gateway Interface Web HTML Web Web CGI CGI CGI Perl, PHP C JavaScript Web CGI HTML 1.2 Servlet Java Servlet Servlet CGI Web CGI Java Java JVM Java CGI

More information

ワークショップ テスト駆動開発

ワークショップ テスト駆動開発 JUnit 5 5 20 20 FIT 20 FIT FIT 10 IT OO Web XML ADC2003 WG JUnit JUnit 3.8.1 URL: http://www.junit.org/index.htm junit.3.8.1.zip junit.jar c: junit junit.jar javac -classpath c: junit junit.jar JUnitTest.java

More information

untitled

untitled -1- 1. JFace Data Binding JFace Data Binding JFace SWT JFace Data Binding JavaBean JFace Data Binding JavaBean JFace Data Binding 1JFace Data Binding JavaBean JavaBean JavaBean name num JavaBean 2JFace

More information

Web 1 p.2 1 Servlet Servlet Web Web Web Apache Web Servlet JSP Web Apache Tomcat Jetty Apache Tomcat, Jetty Java JDK, Eclipse

Web 1 p.2 1 Servlet Servlet Web Web Web Apache Web Servlet JSP Web Apache Tomcat Jetty Apache Tomcat, Jetty Java JDK, Eclipse Web 1 p.1 1 Servlet 1.1 Web Web WWW HTML CGI Common Gateway Interface Web HTML Web Web CGI CGI CGI Perl, PHP C Java Applet JavaScript Web CGI HTML 1.2 Servlet Java Servlet Servlet CGI Web CGI 1 Java Java

More information

Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN Exam's Question and Answers 1 from Ac

Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN Exam's Question and Answers 1 from Ac Actual4Test http://www.actual4test.com Actual4test - actual test exam dumps-pass for IT exams Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN

More information

intra-mart Accel Platform — イベントナビゲータ 開発ガイド   初版  

intra-mart Accel Platform — イベントナビゲータ 開発ガイド   初版   Copyright 2013 NTT DATA INTRAMART CORPORATION 1 Top 目次 intra-mart Accel Platform イベントナビゲータ開発ガイド初版 2013-07-01 改訂情報概要イベントフローの作成 更新 削除をハンドリングするイベントフローを非表示にする回答を非表示にするリンクを非表示にするタイトル コメントを動的に変更するリンク情報を動的に変更するナビゲート結果のリンクにステータスを表示する

More information

K227 Java 2

K227 Java 2 1 K227 Java 2 3 4 5 6 Java 7 class Sample1 { public static void main (String args[]) { System.out.println( Java! ); } } 8 > javac Sample1.java 9 10 > java Sample1 Java 11 12 13 http://java.sun.com/j2se/1.5.0/ja/download.html

More information

Quick Sort 計算機アルゴリズム特論 :2017 年度 只木進一

Quick Sort 計算機アルゴリズム特論 :2017 年度 只木進一 Quick Sort 計算機アルゴリズム特論 :2017 年度 只木進一 2 基本的考え方 リスト ( あるいは配列 )SS の中の ある要素 xx(pivot) を選択 xx より小さい要素からなる部分リスト SS 1 xx より大きい要素からなる部分リスト SS 2 xx は SS 1 または SS 2 に含まれる 長さが 1 になるまで繰り返す pivot xx の選び方として 中央の要素を選択すると効率が良い

More information

HTML Java Tips dp8t-asm/java/tips/ Apache Tomcat Java if else f

HTML Java Tips   dp8t-asm/java/tips/ Apache Tomcat Java if else f 1 Servlet 1.1 Web Web WWW HTML CGI Common Gateway InterfaceWeb HTML Web Web CGI CGI CGI Perl C Java Applet JavaScript Web CGI HTML 1.2 Servlet Java Servlet Servlet CGI Web CGI 1 Java / Java Java CGI Servlet

More information

Q&A集

Q&A集 & ver.2 EWEB-3C-N080 PreSerV for Web MapDataManager & i 1... 1 1.1... 1 1.2... 2 1.3... 6 1.4 MDM. 7 1.5 ( )... 9 1.6 ( )...12 1.7...14 1.8...15 1.9...16 1.10...17 1.11...18 1.12 19 1.13...20 1.14...21

More information

解きながら学ぶJava入門編

解きながら学ぶJava入門編 44 // class Negative { System.out.print(""); int n = stdin.nextint(); if (n < 0) System.out.println(""); -10 Ÿ 35 Ÿ 0 n if statement if ( ) if i f ( ) if n < 0 < true false true false boolean literalboolean

More information

HTML Java Tips dp8t-asm/java/tips/ Apache Tomcat Java if else f

HTML Java Tips   dp8t-asm/java/tips/ Apache Tomcat Java if else f 1 Servlet 1.1 Web Web WWW HTML CGI Common Gateway InterfaceWeb HTML Web Web CGI CGI CGI Perl C Java Applet JavaScript Web CGI HTML 1.2 Servlet Java Servlet Servlet CGI Web CGI 1 Java / Java Java CGI Servlet

More information

目的 泡立ち法を例に Comparableインターフェイスの実装 抽象クラスの利用 型パラメタの利用 比較 入替 の回数を計測

目的 泡立ち法を例に Comparableインターフェイスの実装 抽象クラスの利用 型パラメタの利用 比較 入替 の回数を計測 泡立ち法とその実装 計算機アルゴリズム特論 :2017 年度只木進一 目的 泡立ち法を例に Comparableインターフェイスの実装 抽象クラスの利用 型パラメタの利用 比較 入替 の回数を計測 Comparable インターフェイ ス クラスインスタンスが比較可能であることを示す Int compareto() メソッドを実装 Integer Double String などには実装済み public

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション Oracle Application Server 10g (10.1.2) Oracle Application Server10g(10.1.2) : data-sources.xml WAR (Web ) : orion-web.xml JAR (Enterprise JavaBeans) : orion-ejb-jar.xml EAR ( ) : orion-application.xml

More information

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV tutimura@mist.i.u-tokyo.ac.jp kaneko@ipl.t.u-tokyo.ac.jp http://www.misojiro.t.u-tokyo.ac.jp/ tutimura/sem3/ 2002 12 11 p.1/33 10/16 1. 10/23 2. 10/30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20

More information

(Eclipse\202\305\212w\202\324Java2\215\374.pdf)

(Eclipse\202\305\212w\202\324Java2\215\374.pdf) C H A P T E R 11 11-1 1 Sample9_4 package sample.sample11; public class Sample9_4 { 2 public static void main(string[] args) { int[] points = new int[30]; initializearray(points); double averagepoint =

More information

intra-mart Accel Platform — イベントナビゲータ 開発ガイド   初版   None

intra-mart Accel Platform — イベントナビゲータ 開発ガイド   初版   None クイック検索検索 目次 Copyright 2013 NTT DATA INTRAMART CORPORATION 1 Top 目次 intra-mart Accel Platform イベントナビゲータ開発ガイド初版 2013-07-01 None 改訂情報概要イベントフローの作成 更新 削除をハンドリングするイベントフローを非表示にする回答を非表示にするリンクを非表示にするタイトル コメントを動的に変更するリンク情報を動的に変更するナビゲート結果のリンクにステータスを表示する

More information

. IDE JIVE[1][] Eclipse Java ( 1) Java Platform Debugger Architecture [5] 3. Eclipse GUI JIVE 3.1 Eclipse ( ) 1 JIVE Java [3] IDE c 016 Information Pr

. IDE JIVE[1][] Eclipse Java ( 1) Java Platform Debugger Architecture [5] 3. Eclipse GUI JIVE 3.1 Eclipse ( ) 1 JIVE Java [3] IDE c 016 Information Pr Eclipse 1,a) 1,b) 1,c) ( IDE) IDE Graphical User Interface( GUI) GUI GUI IDE View Eclipse Development of Eclipse Plug-in to present an Object Diagram to Debug Environment Kubota Yoshihiko 1,a) Yamazaki

More information

(Microsoft PowerPoint - \223\306\217KJAVA\221\346\202R\224\ ppt)

(Microsoft PowerPoint - \223\306\217KJAVA\221\346\202R\224\ ppt) 独習 JAVA 第 3 版 8.4 例外とエラークラス 8.5 throws ステートメント 8.6 独自の例外 Throwable コンストラクタ catch ブロックには Throwable 型のパラメータが必ず 1 つなければならない Throwable コンストラクタ Throwable() Throwable( String message ) message には問題を通知する文字列のメッセージ

More information

Microsoft PowerPoint - Lecture_3

Microsoft PowerPoint - Lecture_3 プログラミング III 第 3 回 : サーブレットリクエスト & サーブレットレスポンス処理入門 Ivan Tanev 講義の構造 1. サーブレットの構造 2. サーブレットリクエスト サーブレットレスポンスとは 3. 演習 2 Lecture2_Form.htm 第 2 回のまとめ Web サーバ Web 1 フォーム static 2 Internet サーブレ4 HTML 5 ットテキスト

More information

$ java StoreString abc abc ed abced twice abcedabced clear xyz xyz xyz bingo! abc bingo!abc ^Z mport java.io.*; ublic class StoreString { public static void main(string[] args) throws IOException{ BufferedReader

More information

Spring Framework Web Web Web DB AOP DI Java EE 3 Web WebMVC Web Java 4 DB H2 Database Java H2 Database http://www.h2database.com/ Version 1.0 Zip 5 H2 > cd $H2_HOME/bin > java cp h2.jar org.h2.tools.server

More information

3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello World");

3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println(Hello World); (Basic Theory of Information Processing) Java (eclipse ) Hello World! eclipse Java 1 3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello

More information

"CAS を利用した Single Sign On 環境の構築"

CAS を利用した Single Sign On 環境の構築 CAS Single Sign On (Hisashi NAITO) naito@math.nagoya-u.ac.jp Graduate School of Mathematics, Nagoya University naito@math.nagoya-u.ac.jp, Oct. 19, 2005 Tohoku Univ. p. 1/40 Plan of Talk CAS CAS 2 CAS Single

More information

BlueJ 2.0.1 BlueJ 2.0.x Michael Kölling Mærsk Institute University of Southern Denmark Toin University of Yokohama Alberto Palacios Pawlovsky 17 4 4 3 1 5 1.1 BlueJ.....................................

More information

9iAS_DEV.PDF

9iAS_DEV.PDF Oracle9i Application Server for Windows NT 1.0.2.0.0 2001.2.1 1 1 PL/SQL...3 1.1...3 1.2 PL/SQL Web Toolkit...5 1.3 Database Access Descriptor...6 1.4 PL/SQL...8 1.5 PL/SQL...10 1.6 PL/SQL...12 2 SERVLET...13

More information

Oracle9i JDeveloper R9.0.3 チュートリアル

Oracle9i JDeveloper R9.0.3 チュートリアル Oracle9i JDeveloper 9.0.3 JavaServer Pages Creation Date: Jan. 27, 03 Last Update: Feb. 13, 03 Version: 1.0 ... 2... 2... 2 JDeveloper JSP... 3... 4 JSP... 5 JSP... 6... 7...10 JDeveloper... 12 TLD...

More information

Java (5) 1 Lesson 3: x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java , 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) "flow

Java (5) 1 Lesson 3: x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java , 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) flow Java (5) 1 Lesson 3: 2008-05-20 2 x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java 1.1 10 10 0 1.0 2.0, 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) "flowrate.dat" 10 8 6 4 2 0 0 5 10 15 20 25 time (s) 1 1

More information

Java プログラミング Ⅰ 3 回目変 数 今日の講義講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能 変数は 型 ( データ型 ) と識別子をもちます 2 型 ( データ型 ) 変数に記憶する値の種類変数の型は 記憶できる値の種類と範囲

Java プログラミング Ⅰ 3 回目変 数 今日の講義講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能 変数は 型 ( データ型 ) と識別子をもちます 2 型 ( データ型 ) 変数に記憶する値の種類変数の型は 記憶できる値の種類と範囲 Java プログラミング Ⅰ 3 回目変 数 今日の講義講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能 変数は 型 ( データ型 ) と識別子をもちます 2 型 ( データ型 ) 変数に記憶する値の種類変数の型は 記憶できる値の種類と範囲を決定します 次の型が利用でき これらの型は特に基本型とよばれます 基本型 値の種類 値の範囲 boolean

More information

JavaFest04.PDF

JavaFest04.PDF J2EE EJB3.0 EoD EoD J2EE Container Component Container Component DI Annotation Container Create Passivate Component Remove Activate Remote Bank.java public interface Bank extends EJBObject { public void

More information

untitled

untitled Java JCE JAVA API 1 2 java.seceurity.* javax.crypto.* / MAC (Message Authentication Code) ( ) java.security () javax.crypto 2004/8/26 Java JCE 3 getinstance() Provider Provider

More information

Javaセキュアコーディングセミナー東京 第2回 数値データの取扱いと入力値の検証 演習解説

Javaセキュアコーディングセミナー東京 第2回 数値データの取扱いと入力値の検証 演習解説 Japan Computer Emergency Response Team Coordination Center 電子署名者 : Japan Computer Emergency Response Team Coordination Center DN : c=jp, st=tokyo, l=chiyoda-ku, email=office@jpcert.or.jp, o=japan Computer

More information

Microsoft Word - jpluginmanual.doc

Microsoft Word - jpluginmanual.doc TogoDocClient TogoDocClient... i 1.... 1 2. TogoDocClient... 1 2.1.... 1 2.1.1. JDK 5.0... 1 2.1.2. Eclipse... 1 2.1.3.... 1 2.1.4.... 2 2.2.... 3 2.2.1.... 3 2.2.2.... 4 2.3. Eclipse Commands... 5 2.3.1....

More information

1: JX-model XML File Package Import Class Intf Ctor Method SInit Field Param Local ExtdOpt ImplOpt ThrwOpt Members QName Type Stmt Label Expr ident li

1: JX-model XML File Package Import Class Intf Ctor Method SInit Field Param Local ExtdOpt ImplOpt ThrwOpt Members QName Type Stmt Label Expr ident li Sapid JX-model ver. 1.3.13 2003 2 27 1 JX-model Java XML JX-model JX-model Java (Java 2 ver. 1.4) 20 7 JX-model 1 ^ $ Child nodes JX-model / ( ) JX-model @ @id @sort 1.1 File File JX-model XML /Package,

More information

2

2 Yoshio Terada Java Evangelist http://yoshio3.com, Twitter : @yoshioterada 1 2 3 4 5 1996 6 JDK1.0 Thread Runnable 1997 1998 JDK1.1 J2SE1.2 2000 2002 J2SE 1.3 J2SE 1.4 2004 2006 Java SE 6 JSR-166x Java

More information

intra-mart Accel Platform

intra-mart Accel Platform 目次目次 Copyright 2014 NTT DATA INTRAMART CORPORATION クイック検索検索 1 Top 目次 1. 改訂情報 2. はじめに 2.1. 本書の目的 2.2. 対象読者 2.3. 対象開発モデル 2.4. サンプルコードについて 2.5. 本書の構成 3. アクセスコンテキストの実装 3.1. アクセスコンテキストの実装例 3.2. アクセスコンテキストのキャッシュ機能の実装例

More information

http://www.impressjapan.jp/ Copyright 2014 Socius Japan, Inc. All rights reserved. Java SE 7 Java SE 7 OCJ-P Bronze SE 7 Java Java SE 7 Bronze OCJ-P Silver SE 7 Java Java SE 7 Programmer I OCJ-P Gold

More information

SCA BB Service Configuration API を使用したプログラミング

SCA BB Service Configuration API  を使用したプログラミング CHAPTER 3 SCA BB Service Configuration API を使用したプログラミング この章では Cisco SCA BB Service Configuration API(Service Configuration API) の主なクラスおよび方式についてします プログラミングに関するガイドラインおよびコードの例も示します Service Configuration API

More information

2 1 Web Java Android Java 1.2 6) Java Java 7) 6) Java Java (Swing, JavaFX) (JDBC) 7) OS 1.3 Java Java

2 1 Web Java Android Java 1.2 6) Java Java 7) 6) Java Java (Swing, JavaFX) (JDBC) 7) OS 1.3 Java Java 1 Java Java 1.1 Java 1) 2) 3) Java OS Java 1.3 4) Java Web Start Web / 5) Java C C++ Java JSP(Java Server Pages) 1) OS 2) 3) 4) Java Write Once, Run Anywhere 5) Java Web Java 2 1 Web Java Android Java

More information

JavaプログラミングⅠ

JavaプログラミングⅠ Java プログラミング Ⅰ 3 回目変数 今日の講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能です 変数は 型 ( データ型ともいいます ) と識別子をもちます 2 型 変数に記憶できる値の種類です型は 値の種類に応じて次の 8 種類があり これを基本型といいます 基本型値の種類値の範囲または例 boolean 真偽値 true または

More information

55 7 Java C Java TCP/IP TCP/IP TCP TCP_RO.java import java.net.*; import java.io.*; public class TCP_RO { public static void main(string[] a

55 7 Java C Java TCP/IP TCP/IP TCP TCP_RO.java import java.net.*; import java.io.*; public class TCP_RO { public static void main(string[] a 55 7 Java C Java TCP/IP TCP/IP 7.1 7.1.1 TCP TCP_RO.java import java.net.*; import java.io.*; public class TCP_RO { public static void main(string[] argv) { Socket readsocket = new Socket(argv[0], Integer.parseInt(argv[1]));

More information

「Android Studioではじめる 簡単Androidアプリ開発」正誤表

「Android Studioではじめる 簡単Androidアプリ開発」正誤表 Android Studio Android 2016/04/19 Android Studio Android *1 Android Studio Android Studio Android Studio Android Studio Android PDF : Android Studio Android Android Studio Android *2 c R TM *1 Android

More information

main.dvi

main.dvi Dec. 3, 1998 http://www.jaist.ac.jp/ kaiya/ 1??...? : Java RMI http://www.jaist.ac.jp/ kaiya/ 2 ( ) [1] [2] Bertrand Meyer. The Next Software Breakthrough. COMPUTER, Vol. 30, No. 7, pp. 113 114, Jul. 1997.

More information

tkk0408nari

tkk0408nari SQLStatement Class Sql Database SQL Structured Query Language( ) ISO JIS http://www.techscore.com/tech/sql/02_02.html Database sql Perl Java SQL ( ) create table tu_data ( id integer not null, -- id aid

More information

Javaセキュアコーディングセミナー2013東京第1回 演習の解説

Javaセキュアコーディングセミナー2013東京第1回 演習の解説 Java セキュアコーディングセミナー東京 第 1 回オブジェクトの生成とセキュリティ 演習の解説 2012 年 9 月 9 日 ( 日 ) JPCERT コーディネーションセンター脆弱性解析チーム戸田洋三 1 演習 [1] 2 演習 [1] class Dog { public static void bark() { System.out.print("woof"); class Bulldog

More information

VB.NETコーディング標準

VB.NETコーディング標準 (C) Copyright 2002 Java ( ) VB.NET C# AS-IS extremeprogramming-jp@objectclub.esm.co.jp bata@gold.ocn.ne.jp Copyright (c) 2000,2001 Eiwa System Management, Inc. Object Club Kenji Hiranabe02/09/26 Copyright

More information

Client Client public void sendobject(object message) String String Web Container String RemoteEndpoint String Endpoint throwsioexception, EncodeExcept

Client Client public void sendobject(object message) String String Web Container String RemoteEndpoint String Endpoint throwsioexception, EncodeExcept @OnMessage public void handlecounter(int newvalue) {... @OnMessage public void handleboolean(boolean b) {... public void sendobject(object message) throws IOException, EncodeException Client Client public

More information

ストラドプロシージャの呼び出し方

ストラドプロシージャの呼び出し方 Release10.5 Oracle DataServer Informix MS SQL NXJ SQL JDBC Java JDBC NXJ : NXJ JDBC / NXJ EXEC SQL [USING CONNECTION ] CALL [.][.] ([])

More information

Web JavaScript Java Applet Flash ActionScript CGI (C, perl, ruby ) PHP Servlet, JSP (JavaServer Pages) ASP 7-2

Web JavaScript Java Applet Flash ActionScript CGI (C, perl, ruby ) PHP Servlet, JSP (JavaServer Pages) ASP 7-2 Servlet 7-1 Web JavaScript Java Applet Flash ActionScript CGI (C, perl, ruby ) PHP Servlet, JSP (JavaServer Pages) ASP 7-2 Servlet Java CGI Tomcat Apache+Tomcat JSP Web HTML Java Java Servlet ( ) 7-3 Servlet

More information

JavaプログラミングⅠ

JavaプログラミングⅠ Java プログラミング Ⅰ 3 回目変数 今日の講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能です 変数は 型 ( データ型ともいいます ) と識別子をもちます 2 型 変数に記憶できる値の種類です型は 値の種類に応じて次の 8 種類があり これを基本型といいます 基本型値の種類値の範囲または例 boolean 真偽値 true または

More information

Condition DAQ condition condition 2 3 XML key value

Condition DAQ condition condition 2 3 XML key value Condition DAQ condition 2009 6 10 2009 7 2 2009 7 3 2010 8 3 1 2 2 condition 2 3 XML key value 3 4 4 4.1............................. 5 4.2...................... 5 5 6 6 Makefile 7 7 9 7.1 Condition.h.............................

More information

アルゴリズムとデータ構造1

アルゴリズムとデータ構造1 1 200972 (sakai.keiichi@kochi sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi ://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2009/index.html 29 20 32 14 24 30 48 7 19 21 31 Object public class

More information

intra-mart Accel Platform — アクセスコンテキスト 拡張プログラミングガイド   第2版  

intra-mart Accel Platform — アクセスコンテキスト 拡張プログラミングガイド   第2版   Copyright 2014 NTT DATA INTRAMART CORPORATION 1 Top 目次 1. 改訂情報 2. はじめに 2.1. 本書の目的 2.2. 対象読者 2.3. 対象開発モデル 2.4. サンプルコードについて 2.5. 本書の構成 3. アクセスコンテキストの実装 3.1. アクセスコンテキストの実装例 3.2. アクセスコンテキストのキャッシュ機能の実装例 3.3.

More information

PowerPoint Presentation

PowerPoint Presentation ソフトウェア演習 B GUI を持つ Java プログラムの 設計と実装 4.1 例題 :GUI を持った電卓を作ろう プロジェクトCalculator パッケージ名 :example ソースファイル : Calculator.java GUI.java EventProcessor.java 2 4.2 GUI とイベント処理 GUI の構成 :Swing GUI の場合 フレーム JFrame:

More information

1: Preference Display 1 package sample. pref ; 2 3 import android. app. Activity ; 4 import android. content. Intent ; 5 import android. content. Shar

1: Preference Display 1 package sample. pref ; 2 3 import android. app. Activity ; 4 import android. content. Intent ; 5 import android. content. Shar Android 2 1 (Activity) (layout strings.xml) XML Activity (Intent manifest) Android Eclipse XML Preference, DataBase, File 3 2 Preference Preference Preference URL:[http://www.aichi-pu.ac.jp/ist/lab/yamamoto/android/android-tutorial/tutorial02/tutorial02.pdf]

More information

ALG ppt

ALG ppt 2012614 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2012/index.html 1 2 2 3 29 20 32 14 24 30 48 7 19 21 31 4 N O(log N) 29 O(N) 20 32 14 24 30 48 7 19 21 31 5

More information

Cubby in Action

Cubby in Action Building Web Applications With the Leading Java Framework Cubby IN ACTION アジェンダ Cubby in "real" service 実サービスでの Cubby の利用例 Here Comes Cubby 2.0!! Cubby 2.0 での新機能紹介 2 自己紹介 名前 : 染田貴志 o http://d.hatena.ne.jp/tksmd/

More information

JavaScript の使い方

JavaScript の使い方 JavaScript Release10.5 JavaScript NXJ JavaScript JavaScript JavaScript 2 JavaScript JavaScript JavaScript NXJ JavaScript 1: JavaScript 2: JavaScript 3: JavaScript 4: 1 1: JavaScript JavaScript NXJ Static

More information

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1 I117 II I117 PROGRAMMING PRACTICE II 2 MEMORY MANAGEMENT 2 Research Center for Advanced Computing Infrastructure (RCACI) / Yasuhiro Ohara yasu@jaist.ac.jp / SCHEDULE 1. 2011/06/07(Tue) / Basic of Programming

More information

226

226 226 227 Main ClientThread Request Channel WorkerThread Channel startworkers takerequest requestqueue threadpool WorkerThread channel run Request tostring execute name number ClientThread channel random

More information

1 Java Java GUI , 2 2 jlabel1 jlabel2 jlabel3 jtextfield1 jtextfield2 jtextfield3 jbutton1 jtextfield1 jtextfield2 jtextfield3

1 Java Java GUI , 2 2 jlabel1 jlabel2 jlabel3 jtextfield1 jtextfield2 jtextfield3 jbutton1 jtextfield1 jtextfield2 jtextfield3 1 2 2 1 2 2.1.................................................... 2 2.2.................................................... 2 2.3........................................ 2 2.4....................................................

More information

FileMaker ODBC and JDBC Guide

FileMaker ODBC and JDBC Guide FileMaker 13 ODBC JDBC 2004-2013 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker Bento FileMaker, Inc. FileMaker WebDirect Bento FileMaker,

More information

{:from => Java, :to => Ruby } Java Ruby KAKUTANI Shintaro; Eiwa System Management, Inc.; a strong Ruby proponent http://kakutani.com http://www.amazon.co.jp/o/asin/4873113202/kakutani-22 http://www.amazon.co.jp/o/asin/477413256x/kakutani-22

More information

Java学習教材

Java学習教材 Java 2016/4/17 Java 1 Java1 : 280 : (2010/1/29) ISBN-10: 4798120987 ISBN-13: 978-4798120980 2010/1/29 1 Java 1 Java Java Java class FirstExample { public static void main(string[] args) { System.out.println("

More information

TopLink å SampleClient.java... 5 Ò readallsample() querysample() cachesample() Ç..

TopLink å SampleClient.java... 5 Ò readallsample() querysample() cachesample() Ç.. lê~åäé= qçéiáåâ= NMÖENMKNKPF Volume2 Creation Date: Mar 04, 2005 Last Update: Aug 22, 2005 Version 1.0 ...3... 3 TopLink å...4 1... 4... 4 SampleClient.java... 5 Ò... 8... 9... 10 readallsample()... 11

More information

... 2 1 Servlet... 3 1.1... 3 1.2... 4 2 JSP... 6 2.1... 6 JSP... 6... 8 2.2... 9 - Servlet/JSP における 日 本 語 の 処 理 - 1

... 2 1 Servlet... 3 1.1... 3 1.2... 4 2 JSP... 6 2.1... 6 JSP... 6... 8 2.2... 9 - Servlet/JSP における 日 本 語 の 処 理 - 1 Servlet/JSP Creation Date: Oct 18, 2000 Last Update: Mar 29, 2001 Version: 1.1 ... 2 1 Servlet... 3 1.1... 3 1.2... 4 2 JSP... 6 2.1... 6 JSP... 6... 8 2.2... 9 - Servlet/JSP における 日 本 語 の 処 理 - 1 Servlet

More information

インターネットマガジン2001年4月号―INTERNET magazine No.75

インターネットマガジン2001年4月号―INTERNET magazine No.75 i illustration : Hada Eiji 206 INTERNET magazine 2001/4 jdc.sun.co.jp/wireless/ www.nttdocomo.co.jp/mc-user/i/java/ www.zentek.com/i-jae/ja/download.html INTERNET magazine 2001/4 207 Jump 01 Jump 02 Jump

More information

サーブレット (Servlet) とは Web サーバ側で動作する Java プログラム 通常はapache 等のバックグラウンドで動作する Servletコンテナ上にアプリケーションを配置 代表的な Servlet コンテナ Apache Tomcat WebLogic WebSphere Gla

サーブレット (Servlet) とは Web サーバ側で動作する Java プログラム 通常はapache 等のバックグラウンドで動作する Servletコンテナ上にアプリケーションを配置 代表的な Servlet コンテナ Apache Tomcat WebLogic WebSphere Gla サーブレット 1 オブジェクト指向プログラミング特論 サーブレット (Servlet) とは Web サーバ側で動作する Java プログラム 通常はapache 等のバックグラウンドで動作する Servletコンテナ上にアプリケーションを配置 代表的な Servlet コンテナ Apache Tomcat WebLogic WebSphere GlassFish 2 オブジェクト指向プログラミング特論

More information

SpringSecurity

SpringSecurity Spring Security 1/40 OUTLINE Spring Security Spring Securityを使った認証の仕組み Spring Securityを使った独自認証 認証エラーメッセージの変更 2/40 Spring Security 3/40 Spring Security とは アプリケーションのセキュリティを高めるためのフレームワーク 認証 認可機能 その他 多数のセキュリティ関連の機能を持つ

More information

Java - Visual Editor

Java - Visual Editor Visual Editor で Swing アプリケーションを作成 Swing プログラミングに慣れて居ても ソースコード上丈で思い通りの GUI を作成するのは 可成り骨の折れる作業で有る Visual Editor を使用すれば 試行錯誤し乍ら 非常に簡単に GUI アプリケーションを作成する事が出来る 此処では JFrame を拡張して 簡単なアプリケーションを作成して観る事にする Java

More information

コーディング基準.PDF

コーディング基準.PDF Java Java Java Java.java.class 1 private public package import / //////////////////////////////////////////////////////////////////////////////// // // // // ////////////////////////////////////////////////////////////////////////////////

More information

untitled

untitled Java EE EJB SOA 2007 11 2 Java Java Java (JJUG) Java http://www.java-users.jp/ Java JJUG 2007 Fall 11 6 ( ) http://www.javausers.jp/contents/events/ccc2007fall/ EJB SOA EJB SOA IT EoD IT X-Over Development

More information

アプリケーションサーバ用データベースアクセス 汎用コントロール Version Copyright(c) 2004 MRO co;ltd All Rights Reserved

アプリケーションサーバ用データベースアクセス 汎用コントロール Version Copyright(c) 2004 MRO co;ltd All Rights Reserved アプリケーションサーバ用データベースアクセス 汎用コントロール Version 2.0.0 目 次 1. はじめに... 1 2. 概要... 2 3. セットアップ方法... 3 3.1.NET 版をご利用の例... 3 3.1.1 サーバの配置例... 3 3.1.2 各種モジュールの配置... 3 3.1.3 環境定義ファイル... 4 3.2 J2EE 版をご利用の例... 5 3.2.1

More information

Applet java.lang.object java.awt.component java.awt.container java.awt.panel java.applet.applet

Applet java.lang.object java.awt.component java.awt.container java.awt.panel java.applet.applet 13 Java 13.9 Applet 13.10 AppletContext 13.11 Applet java.lang.object java.awt.component java.awt.container java.awt.panel java.applet.applet Applet (1/2) Component GUI etc Container Applet (2/2) Panel

More information

用 日 力力 生 大 用 生 目 大 用 行行

More information

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value = Part2-1-3 Java (*) (*).class Java public static final 1 class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value

More information

2: 3: A, f, φ f(t = A sin(2πft + φ = A sin(ωt + φ ω 2πf 440Hz A ( ( 4 ( 5 f(t = sin(2πf 1t + sin(2πf 2 t = 2 sin(2πt(f 1 + f 2 /2 cos(2πt(f 1 f

2: 3: A, f, φ f(t = A sin(2πft + φ = A sin(ωt + φ ω 2πf 440Hz A ( ( 4 ( 5 f(t = sin(2πf 1t + sin(2πf 2 t = 2 sin(2πt(f 1 + f 2 /2 cos(2πt(f 1 f 12 ( TV TV, CATV, CS CD, DAT, DV, DVD ( 12.1 12.1.1 1 1: T (sec f (Hz T= 1 f P a = N/m 2 1.013 10 5 P a 1 10 5 1.00001 0.99999 2,3 1 2: 3: 12.1.2 A, f, φ f(t = A sin(2πft + φ = A sin(ωt + φ ω 2πf 440Hz

More information

JBoss Application Server におけるディレクトリトラバーサルの脆弱性

JBoss Application Server におけるディレクトリトラバーサルの脆弱性 Japan Computer Emergency Response Team Coordination Center 電子署名者 Japan Computer Emergency Response Team Coordination Center DN c=jp, st=tokyo, l=chiyoda-ku, email=office@jpcert.or.jp, o=japan Computer

More information

IIJ Technical WEEK REST API型クラウドストレージサービス「FV/S」の自社への実装

IIJ Technical WEEK REST API型クラウドストレージサービス「FV/S」の自社への実装 Tech WEEK 2011 REST API FV/S 2011/11/09 1 FV/S / 2 FV/S 3 FV/S RESTful API HTTP S REST API FV/S API - - - - GET Object VPN / NW 4 / IIJ API Java Python C# HTTP(S) (HTTPS) SAN I/O 5 IIJ I/O FV/S API / 6

More information

Programming-C-9.key

Programming-C-9.key プログラミングC 第9回 例外 スレッド 白石路雄 2 finally try{ ( 例外が発生するかもしれない処理 ) catch(exception のクラス名 e){ ( 例外が発生した時の処理 ) finally{ ( 例外の発生の有無に関わらず 必ず行う処理 ) 3 Integer.parseInt() NumberFormatException

More information

Q&A集

Q&A集 MapViewer & ver.2 EWEB-3C-N055 PreSerV for Web MapViewer & i 1... 1 1.1... 1 1.2... 2 1.3... 3 1.4... 4 1.5... 5 1.6... 6 1.7... 7 1.8... 8 1.9... 9 1.10...11 1.11...12 1.12...13 1.13...14 1.14...15 1.15...16

More information

B2-Servlet-0112.PDF

B2-Servlet-0112.PDF B-2 Servlet/JSP Agenda J2EE Oracle8i J2EE Java Servlet JavaServer Pages PDA ( J2EE Java2 Enterprise Edition API API J2SE JSP Servlets RMI/IIOP EJB JNDI JTA JDBC JMS JavaMail JAF Java2 Standard Edition

More information