[Pljava-dev] ResultSet from trigger screwy with timestamp type

From: JBurtenshaw at cooperstandard(dot)com (Burtenshaw, John J(dot))
To:
Subject: [Pljava-dev] ResultSet from trigger screwy with timestamp type
Date: 2005-09-02 13:40:43
Message-ID: 75F39425D1954A4380D5C9E1D630CDC91D4377@C2A007.stratford.auto.cooperintra.ctb
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev


Thomas:
Thanks for your reply. Sorry for the confustion with gcj. I am using the following 'binary' from the pljava home site:

pljava-i686-pc-linux-gnu-pg8.0-1.1.0.tar.gz

I believe it is PLJava 1.1. I am also using Postgresql 8.0.3. Is there a way of determining if the debian package of postgresql that I have installed is compiled with the integer/timestamp support? I'm guessing that we want integer/timestamp support for PLjava to work properly.

Thanks in advance
John Burtenshaw

-----Original Message-----
From: pljava-dev-bounces at gborg.postgresql.org on behalf of Thomas Hallgren
Sent: Thu 9/1/2005 1:59 AM
To: Burtenshaw, John J.
Cc: pljava-dev at gborg.postgresql.org
Subject: Re: [Pljava-dev] ResultSet from trigger screwy with timestamp type

Hi John,
There has been some problems with timestamps before that where related
to how PostgreSQL was compiled (using integer datetimes or not) but that
was fixed some time ago to allow PL/Java dynamically adapt at runtime.

I'm a bit uncertain of what versions you are using. There's no binary
distribution of PL/Java for gcj. Perhaps you consider gcj "binary java"?
If so, what version of gcj do you have when you compile and what version
of the PL/Java source are you using?

Regards,
Thomas Hallgren

Burtenshaw, John J. wrote:

>
> Greetings. I am using PLJava to fire a trigger on a table as such:
>
> CREATE FUNCTION statsupdate( )
> RETURNS "trigger"
> LANGUAGE 'java'
> AS
> 'com.cooperstandard.statsanalysis.RheologicTrigger.tfunction';
>
> CREATE TRIGGER mv_trigger AFTER INSERT ON mv_results FOR EACH ROW
> EXECUTE PROCEDURE statsupdate();
>
> The 'mv_table' that the trigger is made on appears below:
>
> Column Type
> batch_number integer
> date timestamp
> part_number text
> compound text
> batch_status character(1)
> ml_torq double precision
> mlplus2_torq double precision
> mlplus4_torq double precision
> ts5_time double precision
> ts10_time double precision
> ts35_time double precision
> internal_status character(1)
> instrument integer
>
>
> Everything is fine till the ResultSet from the trigger is examined
> which shows something other than the correct
> value for the 'date' column which is a timestamp type.
> For example the statement "insert into mv_results values( 1011784,
> 'now', '63484', '9620-60', 'a', 50.4, 51.3, 0, 0, 0, 0, 'a', 6);'
>
> Puts a timestamp of '2005-08-31 10:01:21.731671-04' into the database,
> but the java code:
>
> public static void tfunction( TriggerData td ) throws SQLException,
> Exception
> {
> ResultSet insertedRow = td.getNew();
> Logger.getAnonymousLogger().info( "The date: " +
> insertedRow.getTimestamp("date"));
> ....
>
> gives:
> Aug 31 10:01:22 r3development postgres[2636]: [27-1] INFO: 31 Aug 05
> 09:01:22 com.cooperstandard.stats
> analysis.RheologicTrigger The date: 1975-09-22 02:47:56.000671
>
> All the other column give the correct value. Is there something I am
> missing? Your thoughts would be appreciated.
>
>
> Regards,
> John Burtenshaw
>
> PS
> I am using postgresql 8.0 on a linux (debian) platform and the binary
> version pljava (vs the gcj version).
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Pljava-dev mailing list
>Pljava-dev at gborg.postgresql.org
>http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>
>

_______________________________________________
Pljava-dev mailing list
Pljava-dev at gborg.postgresql.org
http://gborg.postgresql.org/mailman/listinfo/pljava-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20050902/a665fd99/attachment.html>

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Thomas Hallgren 2005-09-02 15:31:28 [Pljava-dev] ResultSet from trigger screwy with timestamp type
Previous Message Thomas Hallgren 2005-09-01 05:59:31 [Pljava-dev] ResultSet from trigger screwy with timestamp type