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.

Cannot use java timestamp

7 posts in EJB Client Last posting was on 2007-03-31 04:42:41.0Z
<Ivan> Posted on 2007-03-09 04:20:00.0Z
From: <Ivan>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Cannot use java timestamp
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: static-ip-55-150-66-202.rev.dyxnet.com
X-Original-NNTP-Posting-Host: static-ip-55-150-66-202.rev.dyxnet.com
Message-ID: <45f0e070$1@forums-1-dub>
Date: 8 Mar 2007 20:20:00 -0800
X-Trace: forums-1-dub 1173414000 202.66.150.55 (8 Mar 2007 20:20:00 -0800)
X-Original-Trace: 8 Mar 2007 20:20:00 -0800, static-ip-55-150-66-202.rev.dyxnet.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:729
Article PK: 424830

Dear all,

My program need to passing a datetime into the ejb function.
The EJB function is accept to receive the timestamp value.
Therefore I used the following code to feed the timestamp value into the EJB
function,
The problem is when I use jvm.createJavaInstance(lts_time, "timestamp")
PowerBuilder will close immediately.

Here is my code:

******************************
Timestamp lts_time

/*
... a lot of code include getting jvm and connection to ejb server,
everything is work except create timestamp datatype
*/

l_jvm.createJavaInstance(lts_time, "TimeStamp") <--- will dead on this line
of code.
lts_time.timestamp(98273)

******************************

Thanks a lot

Ivan


bede Posted on 2007-03-09 09:09:04.0Z
From: bede <bedenosp@msofico.be>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Cannot use java timestamp
Message-ID: <MPG.205b42a56f46fc6c989890@forums.sybase.com>
References: <45f0e070$1@forums-1-dub>
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: uu194-7-38-226.unknown.uunet.be
X-Original-NNTP-Posting-Host: uu194-7-38-226.unknown.uunet.be
Date: 9 Mar 2007 01:09:04 -0800
X-Trace: forums-1-dub 1173431344 194.7.38.226 (9 Mar 2007 01:09:04 -0800)
X-Original-Trace: 9 Mar 2007 01:09:04 -0800, uu194-7-38-226.unknown.uunet.be
Lines: 41
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:730
Article PK: 424832

do you have a generated proxy called "TimeStamp" for the corresponding java class?
if you try-catch(throwable t) around it you shd be able to get a bit more info on what goes
wrong.

we pass timestamps as strings with a fixed format 'yyyy-mm-dd hh:nn:ss.ssss'

Ben

In article <45f0e070$1@forums-1-dub>, <Ivan> says...

> Dear all,
>
> My program need to passing a datetime into the ejb function.
> The EJB function is accept to receive the timestamp value.
> Therefore I used the following code to feed the timestamp value into the EJB
> function,
> The problem is when I use jvm.createJavaInstance(lts_time, "timestamp")
> PowerBuilder will close immediately.
>
> Here is my code:
>
> ******************************
> Timestamp lts_time
>
> /*
> ... a lot of code include getting jvm and connection to ejb server,
> everything is work except create timestamp datatype
> */
>
> l_jvm.createJavaInstance(lts_time, "TimeStamp") <--- will dead on this line
> of code.
> lts_time.timestamp(98273)
>
> ******************************
>
> Thanks a lot
>
> Ivan
>
>
>
>


<Ivan> Posted on 2007-03-10 01:41:07.0Z
From: <Ivan>
Newsgroups: sybase.public.powerbuilder.ejbclient
References: <45f0e070$1@forums-1-dub> <MPG.205b42a56f46fc6c989890@forums.sybase.com>
Subject: Re: Cannot use java timestamp
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: static-ip-55-150-66-202.rev.dyxnet.com
X-Original-NNTP-Posting-Host: static-ip-55-150-66-202.rev.dyxnet.com
Message-ID: <45f20cb3$1@forums-1-dub>
Date: 9 Mar 2007 17:41:07 -0800
X-Trace: forums-1-dub 1173490867 202.66.150.55 (9 Mar 2007 17:41:07 -0800)
X-Original-Trace: 9 Mar 2007 17:41:07 -0800, static-ip-55-150-66-202.rev.dyxnet.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:731
Article PK: 424831

Yes, I can found the java class called "timestamp" inside EJB proxy
deployment library. However, when I use it, it will crash my PB. I found
that have 2 constructor:
1. ts.timestamp( /*long long_1*/, /*long long_2*/, /*long long_3*/, /*long
long_4*/, /*long long_5*/, /*long long_6*/, /*long long_7 */)
2. ts.timestamp( /*longlong longlong_1 */)

Therefore, after call jvm.createJavaInstance(lts_time, "timestamp") then I
try to call the constructor to initial the timestamp class as my example in
my pervious post. Also, even I included the try-catch (exception and
throwable) block also cannot catch any error and crash the PB. After that I
also tried to call ts.valueof( 'yyyy-mm-dd hh:nn:ss.ssss') after called
createJavaInstance, but it will said null object reference. So, I've no idea
how to use it.... Since my past experience to use java_double was very easy,
it just create the instance and then call the constructor, then object can
be use. But timestamp is difference. Do you have any idea or sample code can
teach me how to use the timestamp? Because I already search in Google about
how to use timestamp in PB. But no EJB timestamp information can be return.

Thanks for your reply ;)

Ivan



"bede" <bedenosp@msofico.be>
???????:MPG.205b42a56f46fc6c989890@forums.sybase.com...

> do you have a generated proxy called "TimeStamp" for the corresponding
> java class?
> if you try-catch(throwable t) around it you shd be able to get a bit more
> info on what goes
> wrong.
>
> we pass timestamps as strings with a fixed format 'yyyy-mm-dd
> hh:nn:ss.ssss'
>
> Ben
>
> In article <45f0e070$1@forums-1-dub>, <Ivan> says...
>> Dear all,
>>
>> My program need to passing a datetime into the ejb function.
>> The EJB function is accept to receive the timestamp value.
>> Therefore I used the following code to feed the timestamp value into the
>> EJB
>> function,
>> The problem is when I use jvm.createJavaInstance(lts_time, "timestamp")
>> PowerBuilder will close immediately.
>>
>> Here is my code:
>>
>> ******************************
>> Timestamp lts_time
>>
>> /*
>> ... a lot of code include getting jvm and connection to ejb server,
>> everything is work except create timestamp datatype
>> */
>>
>> l_jvm.createJavaInstance(lts_time, "TimeStamp") <--- will dead on this
>> line
>> of code.
>> lts_time.timestamp(98273)
>>
>> ******************************
>>
>> Thanks a lot
>>
>> Ivan
>>
>>
>>
>>


bede Posted on 2007-03-12 11:33:40.0Z
From: bede <bedenosp@msofico.be>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Cannot use java timestamp
Message-ID: <MPG.205f58c5d200522c989892@forums.sybase.com>
References: <45f0e070$1@forums-1-dub> <MPG.205b42a56f46fc6c989890@forums.sybase.com> <45f20cb3$1@forums-1-dub>
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: uu194-7-38-226.unknown.uunet.be
X-Original-NNTP-Posting-Host: uu194-7-38-226.unknown.uunet.be
Date: 12 Mar 2007 03:33:40 -0800
X-Trace: forums-1-dub 1173699220 194.7.38.226 (12 Mar 2007 03:33:40 -0800)
X-Original-Trace: 12 Mar 2007 03:33:40 -0800, uu194-7-38-226.unknown.uunet.be
Lines: 65
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:732
Article PK: 424833

it's difficult for me to pinpoint the issue you have, but here are some remarks that may be
helpful:

- if createJavaInstance succeeds, then the constructor has been executed, why would you call
it again? The null object reference you're getting is because the createJavaInstance did not
succeed. You need to get that issue fixed first.

- maybe "timestamp" has a naming conflict, i would suggest to generate the proxies using a
prefix, in order to avoid naming conflicts.. eg: use "java_"

If possible, post your script + exported proxy code here.

Ben

In article <45f20cb3$1@forums-1-dub>, <Ivan> says...

> Yes, I can found the java class called "timestamp" inside EJB proxy
> deployment library. However, when I use it, it will crash my PB. I found
> that have 2 constructor:
> 1. ts.timestamp( /*long long_1*/, /*long long_2*/, /*long long_3*/, /*long
> long_4*/, /*long long_5*/, /*long long_6*/, /*long long_7 */)
> 2. ts.timestamp( /*longlong longlong_1 */)
>
> Therefore, after call jvm.createJavaInstance(lts_time, "timestamp") then I
> try to call the constructor to initial the timestamp class as my example in
> my pervious post. Also, even I included the try-catch (exception and
> throwable) block also cannot catch any error and crash the PB. After that I
> also tried to call ts.valueof( 'yyyy-mm-dd hh:nn:ss.ssss') after called
> createJavaInstance, but it will said null object reference. So, I've no idea
> how to use it.... Since my past experience to use java_double was very easy,
> it just create the instance and then call the constructor, then object can
> be use. But timestamp is difference. Do you have any idea or sample code can
> teach me how to use the timestamp? Because I already search in Google about
> how to use timestamp in PB. But no EJB timestamp information can be return.
>
> Thanks for your reply ;)
>
> Ivan
>
>
>
> "bede" <bedenosp@msofico.be>
> ???????:MPG.205b42a56f46fc6c989890@forums.sybase.com...
> > do you have a generated proxy called "TimeStamp" for the corresponding
> > java class?
> > if you try-catch(throwable t) around it you shd be able to get a bit more
> > info on what goes
> > wrong.
> >
> > we pass timestamps as strings with a fixed format 'yyyy-mm-dd
> > hh:nn:ss.ssss'
> >
> > Ben
> >
> > In article <45f0e070$1@forums-1-dub>, <Ivan> says...
> >> Dear all,
> >>
> >> My program need to passing a datetime into the ejb function.
> >> The EJB function is accept to receive the timestamp value.
> >> Therefore I used the following code to feed the timestamp value into the
> >> EJB
> >> function,
> >> The problem is when I use jvm.createJavaInstance(lts_time, "timestamp")
> >> PowerBuilder will close immediately.
> >>
> >> Here is my code:


Gokhan Demir Posted on 2007-03-27 20:34:49.0Z
From: Gokhan Demir <gokhan.demir@igonline.biz>
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Cannot use java timestamp
References: <45f0e070$1@forums-1-dub>
In-Reply-To: <45f0e070$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-9; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 85.105.196.163
X-Original-NNTP-Posting-Host: 85.105.196.163
Message-ID: <46097fe9@forums-1-dub>
Date: 27 Mar 2007 12:34:49 -0800
X-Trace: forums-1-dub 1175027689 85.105.196.163 (27 Mar 2007 12:34:49 -0800)
X-Original-Trace: 27 Mar 2007 12:34:49 -0800, 85.105.196.163
Lines: 65
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:734
Article PK: 424835

Hi,

You cannot use classes that does not have an empty constructor. Java
timestamp is one of them. What I do to overcome this issue is have a
helper wrapper class, that have a function returning a timestamp to me,
such as:

public class JavaHelper implements Serializable
{
public JavaHelper()
{
}

public java.sql.Timestamp makeTimestamp( long t )
{
return new java.sql.Timestamp( t );
}
}

and in your Powerbuilder code:

JavaHelper jh
Timestamp ts
jvm.createInstance( jh, "JavaHelper" )
ts = jh.makeTimestamp( t )

To fake Powerbuilder create proxies for this helper class, make a dummy
remote method in one of your ejbs and generate proxies for that ejb.

Regards,
Gokhan Demir

Ivan wrote:
> Dear all,
>
> My program need to passing a datetime into the ejb function.
> The EJB function is accept to receive the timestamp value.
> Therefore I used the following code to feed the timestamp value into the EJB
> function,
> The problem is when I use jvm.createJavaInstance(lts_time, "timestamp")
> PowerBuilder will close immediately.
>
> Here is my code:
>
> ******************************
> Timestamp lts_time
>
> /*
> ... a lot of code include getting jvm and connection to ejb server,
> everything is work except create timestamp datatype
> */
>
> l_jvm.createJavaInstance(lts_time, "TimeStamp") <--- will dead on this line
> of code.
> lts_time.timestamp(98273)
>
> ******************************
>
> Thanks a lot
>
> Ivan
>
>
>


Gokhan Demir Posted on 2007-03-27 20:50:05.0Z
From: Gokhan Demir <gokhan.demir@igonline.biz>
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Cannot use java timestamp
References: <45f0e070$1@forums-1-dub> <46097fe9@forums-1-dub>
In-Reply-To: <46097fe9@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-9; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 85.105.196.163
X-Original-NNTP-Posting-Host: 85.105.196.163
Message-ID: <4609837d@forums-1-dub>
Date: 27 Mar 2007 12:50:05 -0800
X-Trace: forums-1-dub 1175028605 85.105.196.163 (27 Mar 2007 12:50:05 -0800)
X-Original-Trace: 27 Mar 2007 12:50:05 -0800, 85.105.196.163
Lines: 71
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:736
Article PK: 424837

A correction to the last sentence:
To fake Powerbuilder create proxies for this helper class, make a dummy
remote method in one of your ejbs that takes JavaHelper class as the
dummy method parameter and generate proxies for that ejb.

Gokhan Demir wrote:
> Hi,
>
> You cannot use classes that does not have an empty constructor. Java
> timestamp is one of them. What I do to overcome this issue is have a
> helper wrapper class, that have a function returning a timestamp to me,
> such as:
>
> public class JavaHelper implements Serializable
> {
> public JavaHelper()
> {
> }
>
> public java.sql.Timestamp makeTimestamp( long t )
> {
> return new java.sql.Timestamp( t );
> }
> }
>
> and in your Powerbuilder code:
>
> JavaHelper jh
> Timestamp ts
> jvm.createInstance( jh, "JavaHelper" )
> ts = jh.makeTimestamp( t )
>
> To fake Powerbuilder create proxies for this helper class, make a dummy
> remote method in one of your ejbs and generate proxies for that ejb.
>
> Regards,
> Gokhan Demir
>
>
> Ivan wrote:
>> Dear all,
>>
>> My program need to passing a datetime into the ejb function.
>> The EJB function is accept to receive the timestamp value.
>> Therefore I used the following code to feed the timestamp value into
>> the EJB function,
>> The problem is when I use jvm.createJavaInstance(lts_time,
>> "timestamp") PowerBuilder will close immediately.
>>
>> Here is my code:
>>
>> ******************************
>> Timestamp lts_time
>>
>> /*
>> ... a lot of code include getting jvm and connection to ejb server,
>> everything is work except create timestamp datatype
>> */
>>
>> l_jvm.createJavaInstance(lts_time, "TimeStamp") <--- will dead on
>> this line of code.
>> lts_time.timestamp(98273)
>>
>> ******************************
>>
>> Thanks a lot
>>
>> Ivan
>>
>>
>>


<Ivan> Posted on 2007-03-31 04:42:41.0Z
From: <Ivan>
Newsgroups: sybase.public.powerbuilder.ejbclient
References: <45f0e070$1@forums-1-dub> <46097fe9@forums-1-dub> <4609837d@forums-1-dub>
Subject: Re: Cannot use java timestamp
Lines: 77
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: static-ip-55-150-66-202.rev.dyxnet.com
X-Original-NNTP-Posting-Host: static-ip-55-150-66-202.rev.dyxnet.com
Message-ID: <460de6c1@forums-1-dub>
Date: 30 Mar 2007 20:42:41 -0800
X-Trace: forums-1-dub 1175316161 202.66.150.55 (30 Mar 2007 20:42:41 -0800)
X-Original-Trace: 30 Mar 2007 20:42:41 -0800, static-ip-55-150-66-202.rev.dyxnet.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:737
Article PK: 424838

yup, I think so. maybe this is the only way can fix this problem...
Thanks everyone helping me.

"Gokhan Demir" <gokhan.demir@igonline.biz> ???????:4609837d@forums-1-dub...

>A correction to the last sentence:
> To fake Powerbuilder create proxies for this helper class, make a dummy
> remote method in one of your ejbs that takes JavaHelper class as the dummy
> method parameter and generate proxies for that ejb.
>
> Gokhan Demir wrote:
>> Hi,
>>
>> You cannot use classes that does not have an empty constructor. Java
>> timestamp is one of them. What I do to overcome this issue is have a
>> helper wrapper class, that have a function returning a timestamp to me,
>> such as:
>>
>> public class JavaHelper implements Serializable
>> {
>> public JavaHelper()
>> {
>> }
>>
>> public java.sql.Timestamp makeTimestamp( long t )
>> {
>> return new java.sql.Timestamp( t );
>> }
>> }
>>
>> and in your Powerbuilder code:
>>
>> JavaHelper jh
>> Timestamp ts
>> jvm.createInstance( jh, "JavaHelper" )
>> ts = jh.makeTimestamp( t )
>>
>> To fake Powerbuilder create proxies for this helper class, make a dummy
>> remote method in one of your ejbs and generate proxies for that ejb.
>>
>> Regards,
>> Gokhan Demir
>>
>>
>> Ivan wrote:
>>> Dear all,
>>>
>>> My program need to passing a datetime into the ejb function.
>>> The EJB function is accept to receive the timestamp value.
>>> Therefore I used the following code to feed the timestamp value into the
>>> EJB function,
>>> The problem is when I use jvm.createJavaInstance(lts_time, "timestamp")
>>> PowerBuilder will close immediately.
>>>
>>> Here is my code:
>>>
>>> ******************************
>>> Timestamp lts_time
>>>
>>> /*
>>> ... a lot of code include getting jvm and connection to ejb server,
>>> everything is work except create timestamp datatype
>>> */
>>>
>>> l_jvm.createJavaInstance(lts_time, "TimeStamp") <--- will dead on this
>>> line of code.
>>> lts_time.timestamp(98273)
>>>
>>> ******************************
>>>
>>> Thanks a lot
>>>
>>> Ivan
>>>
>>>
>>>