KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tutorial > blob > client > Client


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.tutorial.blob.client;
8
9 import java.util.HashMap JavaDoc;
10 import javax.naming.InitialContext JavaDoc;
11 import org.jboss.tutorial.blob.bean.LobTester;
12 import org.jboss.tutorial.blob.bean.BlobEntity2;
13
14 /**
15  * Comment
16  *
17  * @author <a HREF="mailto:bill@jboss.org">Bill Burke</a>
18  * @version $Revision: 1.2.2.3 $
19  */

20 public class Client
21 {
22    public static void main(String JavaDoc[] args) throws Exception JavaDoc
23    {
24       InitialContext JavaDoc ctx = new InitialContext JavaDoc();
25       LobTester test = (LobTester) ctx.lookup(LobTester.class.getName());
26       long blobId = test.create();
27       HashMap JavaDoc map = test.findBlob(blobId);
28       System.out.println("is hello in map: " + map.get("hello"));
29       System.out.println(test.findClob(blobId));
30       System.out.println("creating and getting a BlobEntity2 that uses byte[] and String instead of Clob/Blob");
31       blobId = test.create2();
32       BlobEntity2 entity = test.findBlob2(blobId);
33
34    }
35 }
36
Popular Tags