Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Client Example without Sybase classes

5 posts in General Discussion (old) Last posting was on 2000-03-10 15:58:17.0Z
Steve Fennessey Posted on 2000-03-09 16:09:08.0Z
Newsgroups: sybase.public.easerver
Date: Thu, 09 Mar 2000 10:09:08 -0600
From: Steve Fennessey <fennessm@maritz.com>
X-Mailer: Mozilla 4.61 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Client Example without Sybase classes
X-Priority: 1 (Highest)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 5
NNTP-Posting-Host: maritzfw01.maritz.com 207.239.112.18
Message-ID: <347_38C7CCA3.129A5F5B@maritz.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26794
Article PK: 157768

Does anyone have or know of where there is an example
of a java client calling an EJB from Jaguar that does not
use the Sybase classes to call the EJB?

Thanks,
Steve


Dave Wolf [Sybase] Posted on 2000-03-10 01:53:50.0Z
Newsgroups: sybase.public.easerver
From: "Dave Wolf [Sybase]" <dwolf@sybase.com>
Subject: Re: Client Example without Sybase classes
Date: Thu, 9 Mar 2000 20:53:50 -0500
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
NNTP-Posting-Host: PPPa29-ResaleAnnapolis2-1R7132.saturn.bbn.com 4.54.8.90
Message-ID: <347_p$I#Ncji$GA.201@forums.sybase.com>
References: <347_38C7CCA3.129A5F5B@maritz.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26730
Article PK: 154432

Here ya go :)

public class DemoClient
{

public static void main(String[] args)
{
try
{
Context ctx = getInitialContext();
MyBeanHome home = (MyBeanHome) ctx.lookup("MyBean");
MyBean remote = home.create();
remote.someMethod();
}
catch(Exception e)
{
e.printStackTrace();
}
}

protected Context getInitialContext() throws Exception
{
java.util.Properties p = new java.util.Properties();
// Sybase implementation of InitialContextFactory
p.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sybase.ejb.InitialContextFactory");
// URL for the Server's IIOP port
p.put(Context.PROVIDER_URL, "iiop://myhost:9000");
// Username "jagadmin", password is ""
p.put(Context.SECURITY_PRINCIPAL, "foo");
p.put(Context.SECURITY_CREDENTIALS, "");
// Now create an InitialContext that uses the properties
return new InitialContext(p);
}
}

Dave Wolf
Internet Applications Division

"Steve Fennessey" <fennessm@maritz.com> wrote in message
news:38C7CCA3.129A5F5B@maritz.com...
> Does anyone have or know of where there is an example
> of a java client calling an EJB from Jaguar that does not
> use the Sybase classes to call the EJB?
>
> Thanks,
> Steve
>


Steve Fennessey Posted on 2000-03-10 15:58:17.0Z
Newsgroups: sybase.public.easerver
Date: Fri, 10 Mar 2000 09:58:17 -0600
From: Steve Fennessey <fennessm@maritz.com>
X-Mailer: Mozilla 4.61 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Client Example without Sybase classes
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 40
NNTP-Posting-Host: maritzfw01.maritz.com 207.239.112.18
Message-ID: <347_38C91B99.C6D39A8A@maritz.com>
References: <347_38C7CCA3.129A5F5B@maritz.com> <347_p$I#Ncji$GA.201@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26679
Article PK: 154420

Thanks again Dave.

"Dave Wolf [Sybase]" wrote:

> Here ya go :)
>
> public class DemoClient
> {
>
> public static void main(String[] args)
> {
> try
> {
> Context ctx = getInitialContext();
> MyBeanHome home = (MyBeanHome) ctx.lookup("MyBean");
> MyBean remote = home.create();
> remote.someMethod();
> }
> catch(Exception e)
> {
> e.printStackTrace();
> }
> }
>
> protected Context getInitialContext() throws Exception
> {
> java.util.Properties p = new java.util.Properties();
> // Sybase implementation of InitialContextFactory
> p.put(Context.INITIAL_CONTEXT_FACTORY,
> "com.sybase.ejb.InitialContextFactory");
> // URL for the Server's IIOP port
> p.put(Context.PROVIDER_URL, "iiop://myhost:9000");
> // Username "jagadmin", password is ""
> p.put(Context.SECURITY_PRINCIPAL, "foo");
> p.put(Context.SECURITY_CREDENTIALS, "");
> // Now create an InitialContext that uses the properties
> return new InitialContext(p);
> }
> }
>
> Dave Wolf
> Internet Applications Division
>
> "Steve Fennessey" <fennessm@maritz.com> wrote in message
> news:38C7CCA3.129A5F5B@maritz.com...
> > Does anyone have or know of where there is an example
> > of a java client calling an EJB from Jaguar that does not
> > use the Sybase classes to call the EJB?
> >
> > Thanks,
> > Steve
> >


Andreas S. Brunvoll Posted on 2000-03-09 16:51:27.0Z
Newsgroups: sybase.public.easerver
Date: Thu, 09 Mar 2000 17:51:27 +0100
From: "Andreas S. Brunvoll" <abr@avenir.no>
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Client Example without Sybase classes
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 70
NNTP-Posting-Host: 139.108.179.131
Message-ID: <347_38C7D68F.4E87540C@avenir.no>
References: <347_38C7CCA3.129A5F5B@maritz.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26784
Article PK: 157762

I do like this:
All my properties is to be loaded from applet-parameters. This is just testing code, though.

private InitialContext getInitialContext()
        throws NamingException {
  if (jndiContext == null) {
   java.util.Properties p = new java.util.Properties();
   p.put(Context.INITIAL_CONTEXT_FACTORY, "com.sybase.ejb.InitialContextFactory");
   p.put(Context.PROVIDER_URL, "iiop://localhost:9000");
   p.put(Context.SECURITY_PRINCIPAL, "jagadmin");
   p.put(Context.SECURITY_CREDENTIALS, "");
         jndiContext = new InitialContext(p);
  }
  return jndiContext;
    }

    /*
     * Return reference of an ArtsKontoKontroller-object
     */
    private ArtsKontoKontroller getArtsKontoKontroller() {
        ArtsKontoKontroller kontroller = null;
        try {
            InitialContext context = getInitialContext();
            ArtsKontoKontrollerHome home = (ArtsKontoKontrollerHome) context.lookup(ARTSKONTOKONTROLLER);
            kontroller = home.create();
            context = null;
            home = null;
        } catch (NamingException ne) {
            System.out.println(ne.getExplanation());
        } catch (RemoteException e) {
            System.out.println(e.getMessage());
  } catch (CreateException e) {
            System.out.println(e.getMessage());
  }
        return kontroller;
    }
private static final String ARTSKONTOKONTROLLER = "ArtsKontoKontroller";

Steve Fennessey wrote:

Does anyone have or know of where there is an example
of a java client calling an EJB from Jaguar that does not
use the Sybase classes to call the EJB?

Thanks,
Steve


Steve Fennessey Posted on 2000-03-09 17:15:18.0Z
Newsgroups: sybase.public.easerver
Date: Thu, 09 Mar 2000 11:15:18 -0600
From: Steve Fennessey <fennessm@maritz.com>
X-Mailer: Mozilla 4.61 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Client Example without Sybase classes
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 46
NNTP-Posting-Host: maritzfw01.maritz.com 207.239.112.18
Message-ID: <347_38C7DC26.C243D7D4@maritz.com>
References: <347_38C7CCA3.129A5F5B@maritz.com> <347_38C7D68F.4E87540C@avenir.no>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26782
Article PK: 157759

Thanks alot Andreas.

"Andreas S. Brunvoll" wrote:

> I do like this:
> All my properties is to be loaded from applet-parameters. This is just
> testing code, though.
>
> private InitialContext getInitialContext()
> throws NamingException {
> if (jndiContext == null) {
> java.util.Properties p = new java.util.Properties();
> p.put(Context.INITIAL_CONTEXT_FACTORY,
> "com.sybase.ejb.InitialContextFactory");
> p.put(Context.PROVIDER_URL, "iiop://localhost:9000");
> p.put(Context.SECURITY_PRINCIPAL, "jagadmin");
> p.put(Context.SECURITY_CREDENTIALS, "");
> jndiContext = new InitialContext(p);
> }
> return jndiContext;
> }
>
> /*
> * Return reference of an ArtsKontoKontroller-object
> */
> private ArtsKontoKontroller getArtsKontoKontroller() {
> ArtsKontoKontroller kontroller = null;
> try {
> InitialContext context = getInitialContext();
> ArtsKontoKontrollerHome home = (ArtsKontoKontrollerHome)
> context.lookup(ARTSKONTOKONTROLLER);
> kontroller = home.create();
> context = null;
> home = null;
> } catch (NamingException ne) {
> System.out.println(ne.getExplanation());
> } catch (RemoteException e) {
> System.out.println(e.getMessage());
> } catch (CreateException e) {
> System.out.println(e.getMessage());
> }
> return kontroller;
> }
> private static final String ARTSKONTOKONTROLLER =
> "ArtsKontoKontroller";
>
> Steve Fennessey wrote:
>
>> Does anyone have or know of where there is an example
>> of a java client calling an EJB from Jaguar that does not
>> use the Sybase classes to call the EJB?
>>
>> Thanks,
>> Steve
>