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.

Getting value in Any

7 posts in EJB Client Last posting was on 2004-12-11 21:58:42.0Z
Al Posted on 2004-12-06 16:27:10.0Z
Sender: 6dc8.41b4883c.1804289383@sybase.com
From: Al
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Getting value in Any
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41b4885a.6dcc.1681692777@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 6 Dec 2004 08:27:06 -0800, 10.22.241.42
Lines: 18
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 6 Dec 2004 08:27:07 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 6 Dec 2004 08:27:10 -0800
X-Trace: forums-1-dub 1102350430 10.22.108.75 (6 Dec 2004 08:27:10 -0800)
X-Original-Trace: 6 Dec 2004 08:27:10 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:407
Article PK: 424582

Hi,

My Java function returns a string array. From EJB proxy
object, it can only get data in Any data type in this case.

My question is how do I get value from this Any data type.

I tried the follows, but it doesn't work. I also tried
defind the SRet in an any array, no luck either..

any SRet
string Projects[]
...
conn.createJavaInstance(testapi, "my_testapicls")
SRet = testapi.getProjects("TEST81", "baoa", "baoa", ref
theError)
Projects = SRet
....


Jim O'Neil [Sybase] Posted on 2004-12-06 19:28:59.0Z
From: "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Getting value in Any
Message-ID: <vlc9r09jgbnb2v268ecro3alst3hsdhbce@4ax.com>
References: <41b4885a.6dcc.1681692777@sybase.com>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: joneilw2k.sybase.com
X-Original-NNTP-Posting-Host: joneilw2k.sybase.com
Date: 6 Dec 2004 11:28:59 -0800
X-Trace: forums-1-dub 1102361339 10.18.43.140 (6 Dec 2004 11:28:59 -0800)
X-Original-Trace: 6 Dec 2004 11:28:59 -0800, joneilw2k.sybase.com
Lines: 26
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:408
Article PK: 424583

That should be working. Any is returned because PB syntax does not
support returning arrays as function arguments. Are you certain that
the array is populated correctly? What does UpperBound(Projects)
return?

On 6 Dec 2004 08:27:10 -0800, Al wrote:

>Hi,
>
>My Java function returns a string array. From EJB proxy
>object, it can only get data in Any data type in this case.
>
>My question is how do I get value from this Any data type.
>
>I tried the follows, but it doesn't work. I also tried
>defind the SRet in an any array, no luck either..
>
>any SRet
>string Projects[]
>...
>conn.createJavaInstance(testapi, "my_testapicls")
>SRet = testapi.getProjects("TEST81", "baoa", "baoa", ref
>theError)
>Projects = SRet
>....


Al Posted on 2004-12-06 20:26:05.0Z
Sender: 2f98.41b49674.1804289383@sybase.com
From: Al
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Getting value in Any
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41b4c05d.3303.1681692777@sybase.com>
References: <vlc9r09jgbnb2v268ecro3alst3hsdhbce@4ax.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 6 Dec 2004 12:26:05 -0800
X-Trace: forums-1-dub 1102364765 10.22.241.41 (6 Dec 2004 12:26:05 -0800)
X-Original-Trace: 6 Dec 2004 12:26:05 -0800, 10.22.241.41
Lines: 39
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:409
Article PK: 424584

Both UpperBound(Projects) and UpperBound(SRet) are 0.

I am new on Java, but I double checked my Java Code and
don't see where the problem is. Here is my sample Java code:

public String[] testArray(String S1, String S2)
{
String[] Projects = null;
Projects[0] = S1;
Projects[1] = S2;
return Projects;
}

> That should be working. Any is returned because PB syntax
> does not support returning arrays as function arguments.
> Are you certain that the array is populated correctly?
> What does UpperBound(Projects) return?
>
> On 6 Dec 2004 08:27:10 -0800, Al wrote:
>
> >Hi,
> >
> >My Java function returns a string array. From EJB proxy
> >object, it can only get data in Any data type in this
> case. >
> >My question is how do I get value from this Any data
> type. >
> >I tried the follows, but it doesn't work. I also tried
> >defind the SRet in an any array, no luck either..
> >
> >any SRet
> >string Projects[]
> >...
> >conn.createJavaInstance(testapi, "my_testapicls")
> >SRet = testapi.getProjects("TEST81", "baoa", "baoa", ref
> >theError)
> >Projects = SRet
> >....
>


Bede <bede_nosp Posted on 2004-12-07 11:15:37.0Z
From: Bede <bede_nosp@m_sofico.be>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Getting value in Any
Message-ID: <MPG.1c1faf47db9f839a989688@forums.sybase.com>
References: <vlc9r09jgbnb2v268ecro3alst3hsdhbce@4ax.com> <41b4c05d.3303.1681692777@sybase.com>
Organization: Sofico
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
User-Agent: MicroPlanet-Gravity/2.70.2067
NNTP-Posting-Host: d51537152.kabel.telenet.be
X-Original-NNTP-Posting-Host: d51537152.kabel.telenet.be
Date: 7 Dec 2004 03:15:37 -0800
X-Trace: forums-1-dub 1102418137 81.83.113.82 (7 Dec 2004 03:15:37 -0800)
X-Original-Trace: 7 Dec 2004 03:15:37 -0800, d51537152.kabel.telenet.be
Lines: 46
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:410
Article PK: 424585

what pb version & build are you using?
some issues with arrays were there at first, best to use the latest
build of PB9.0.2

Ben
In article <41b4c05d.3303.1681692777@sybase.com>, Al says...

> Both UpperBound(Projects) and UpperBound(SRet) are 0.
>
> I am new on Java, but I double checked my Java Code and
> don't see where the problem is. Here is my sample Java code:
>
> public String[] testArray(String S1, String S2)
> {
> String[] Projects = null;
> Projects[0] = S1;
> Projects[1] = S2;
> return Projects;
> }
>
> > That should be working. Any is returned because PB syntax
> > does not support returning arrays as function arguments.
> > Are you certain that the array is populated correctly?
> > What does UpperBound(Projects) return?
> >
> > On 6 Dec 2004 08:27:10 -0800, Al wrote:
> >
> > >Hi,
> > >
> > >My Java function returns a string array. From EJB proxy
> > >object, it can only get data in Any data type in this
> > case. >
> > >My question is how do I get value from this Any data
> > type. >
> > >I tried the follows, but it doesn't work. I also tried
> > >defind the SRet in an any array, no luck either..
> > >
> > >any SRet
> > >string Projects[]
> > >...
> > >conn.createJavaInstance(testapi, "my_testapicls")
> > >SRet = testapi.getProjects("TEST81", "baoa", "baoa", ref
> > >theError)
> > >Projects = SRet
> > >....
> >
>


Al Posted on 2004-12-07 20:26:07.0Z
Sender: 2f98.41b49674.1804289383@sybase.com
From: Al
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Getting value in Any
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41b611de.4db8.1681692777@sybase.com>
References: <MPG.1c1faf47db9f839a989688@forums.sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 7 Dec 2004 12:26:07 -0800
X-Trace: forums-1-dub 1102451167 10.22.241.41 (7 Dec 2004 12:26:07 -0800)
X-Original-Trace: 7 Dec 2004 12:26:07 -0800, 10.22.241.41
Lines: 48
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:411
Article PK: 424586

I am using PB9.0.1 build 7236.

> what pb version & build are you using?
> some issues with arrays were there at first, best to use
> the latest build of PB9.0.2
>
> Ben
> In article <41b4c05d.3303.1681692777@sybase.com>, Al
> > says... Both UpperBound(Projects) and UpperBound(SRet)
> > are 0.
> > I am new on Java, but I double checked my Java Code and
> > don't see where the problem is. Here is my sample Java
> > code:
> > public String[] testArray(String S1, String S2)
> > {
> > String[] Projects = null;
> > Projects[0] = S1;
> > Projects[1] = S2;
> > return Projects;
> > }
> >
> > > That should be working. Any is returned because PB
> > > syntax does not support returning arrays as function
> > > arguments. Are you certain that the array is populated
> > > correctly? What does UpperBound(Projects) return?
> > >
> > > On 6 Dec 2004 08:27:10 -0800, Al wrote:
> > >
> > > >Hi,
> > > >
> > > >My Java function returns a string array. From EJB
> > > proxy >object, it can only get data in Any data type
> > > in this case. >
> > > >My question is how do I get value from this Any data
> > > type. >
> > > >I tried the follows, but it doesn't work. I also
> > > tried >defind the SRet in an any array, no luck
> > > either.. >
> > > >any SRet
> > > >string Projects[]
> > > >...
> > > >conn.createJavaInstance(testapi, "my_testapicls")
> > > >SRet = testapi.getProjects("TEST81", "baoa", "baoa",
> > > ref >theError)
> > > >Projects = SRet
> > > >....
> > >
> >


Bede <bede_nosp Posted on 2004-12-08 07:39:02.0Z
From: Bede <bede_nosp@m_sofico.be>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Getting value in Any
Message-ID: <MPG.1c20cdfe47f708c989689@forums.sybase.com>
References: <MPG.1c1faf47db9f839a989688@forums.sybase.com> <41b611de.4db8.1681692777@sybase.com>
Organization: Sofico
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
User-Agent: MicroPlanet-Gravity/2.70.2067
X-Original-NNTP-Posting-Host: d51537152.kabel.telenet.be
X-Original-Trace: 7 Dec 2004 23:38:59 -0800, d51537152.kabel.telenet.be
Lines: 80
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 7 Dec 2004 23:39:00 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 7 Dec 2004 23:39:02 -0800
X-Trace: forums-1-dub 1102491542 10.22.108.75 (7 Dec 2004 23:39:02 -0800)
X-Original-Trace: 7 Dec 2004 23:39:02 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:412
Article PK: 424587

i'm not that much of a java-man but are you sure that "String" the same
is as "java.lang.String" ?
FYI, i've listed the datatype mappings below (see PB help)

Ben

Datatype mappings
The EJB Proxy generator maps datatypes between Java and PowerBuilder as
shown in the following table:
Java type PowerBuilder type
short Integer
int Long
long LongLong
float Real
double Double
byte Int
char (16-bit unsigned) Char
java.lang.String String
boolean Boolean
java.util.Date Datetime
Array of primitive type Parameters: Array of primitive type
Return values: Any
Array of java.lang.String or java.util.Date objects Parameters: Array
of String or DateTimeReturn values: Any
Array of arrays Any
Java class arguments or return values PowerBuilder proxies of Java
classes
Other Any


In article <41b611de.4db8.1681692777@sybase.com>, Al says...

> I am using PB9.0.1 build 7236.
>
> > what pb version & build are you using?
> > some issues with arrays were there at first, best to use
> > the latest build of PB9.0.2
> >
> > Ben
> > In article <41b4c05d.3303.1681692777@sybase.com>, Al
> > > says... Both UpperBound(Projects) and UpperBound(SRet)
> > > are 0.
> > > I am new on Java, but I double checked my Java Code and
> > > don't see where the problem is. Here is my sample Java
> > > code:
> > > public String[] testArray(String S1, String S2)
> > > {
> > > String[] Projects = null;
> > > Projects[0] = S1;
> > > Projects[1] = S2;
> > > return Projects;
> > > }
> > >
> > > > That should be working. Any is returned because PB
> > > > syntax does not support returning arrays as function
> > > > arguments. Are you certain that the array is populated
> > > > correctly? What does UpperBound(Projects) return?
> > > >
> > > > On 6 Dec 2004 08:27:10 -0800, Al wrote:
> > > >
> > > > >Hi,
> > > > >
> > > > >My Java function returns a string array. From EJB
> > > > proxy >object, it can only get data in Any data type
> > > > in this case. >
> > > > >My question is how do I get value from this Any data
> > > > type. >
> > > > >I tried the follows, but it doesn't work. I also
> > > > tried >defind the SRet in an any array, no luck
> > > > either.. >
> > > > >any SRet
> > > > >string Projects[]
> > > > >...
> > > > >conn.createJavaInstance(testapi, "my_testapicls")
> > > > >SRet = testapi.getProjects("TEST81", "baoa", "baoa",
> > > > ref >theError)
> > > > >Projects = SRet
> > > > >....
> > > >
> > >
>


Gokhan Demir Posted on 2004-12-11 21:58:42.0Z
From: Gokhan Demir <gokhan.demir@igonline.biz>
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Getting value in Any
References: <vlc9r09jgbnb2v268ecro3alst3hsdhbce@4ax.com> <41b4c05d.3303.1681692777@sybase.com>
In-Reply-To: <41b4c05d.3303.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: adsluser-1165.adsl.ttnet.net.tr
X-Original-NNTP-Posting-Host: adsluser-1165.adsl.ttnet.net.tr
Message-ID: <41bb6d92@forums-1-dub>
Date: 11 Dec 2004 13:58:42 -0800
X-Trace: forums-1-dub 1102802322 212.174.52.141 (11 Dec 2004 13:58:42 -0800)
X-Original-Trace: 11 Dec 2004 13:58:42 -0800, adsluser-1165.adsl.ttnet.net.tr
Lines: 63
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:424
Article PK: 424599

Change your Java function to read:

public String[] testArray( String s1, String s2 )
{
String[] Projects = new String[2];
Projects[0] = S1;
Projects[1] = S2;
return( Projects );
}

Hope it helps,
Gokhan

P.S.: Your code should be throwing an exception that your application
does not catch, or ignore.

Al wrote:
> Both UpperBound(Projects) and UpperBound(SRet) are 0.
>
> I am new on Java, but I double checked my Java Code and
> don't see where the problem is. Here is my sample Java code:
>
> public String[] testArray(String S1, String S2)
> {
> String[] Projects = null;
> Projects[0] = S1;
> Projects[1] = S2;
> return Projects;
> }
>
>
>>That should be working. Any is returned because PB syntax
>>does not support returning arrays as function arguments.
>>Are you certain that the array is populated correctly?
>>What does UpperBound(Projects) return?
>>
>>On 6 Dec 2004 08:27:10 -0800, Al wrote:
>>
>>
>>>Hi,
>>>
>>>My Java function returns a string array. From EJB proxy
>>>object, it can only get data in Any data type in this
>>
>>case. >
>>
>>>My question is how do I get value from this Any data
>>
>>type. >
>>
>>>I tried the follows, but it doesn't work. I also tried
>>>defind the SRet in an any array, no luck either..
>>>
>>>any SRet
>>>string Projects[]
>>>...
>>>conn.createJavaInstance(testapi, "my_testapicls")
>>>SRet = testapi.getProjects("TEST81", "baoa", "baoa", ref
>>>theError)
>>>Projects = SRet
>>>....
>>