Add URL-property to PGXADataSource

From: Andreas Joseph Krogh <andreak(at)officenet(dot)no>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Add URL-property to PGXADataSource
Date: 2011-01-04 11:41:11
Message-ID: 27700153.601.1294141271158.JavaMail.on@prod2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

<p>Hi all!</p>
<p>The PGXADataSource lacks the URL-property which makes it harder to switch between database-vendors using XA-datasources using a unified configuration like Spring where one can use property-replacement to switch URL, username etc. based on properties in a property-file.</p>
<p>Are there any plans to add a URL-property to the PGXADataSource?</p>
<p><br />
<span style="font-family: monospace; font-size: 10px;">--<br />
Andreas Joseph Krogh &lt;andreak(at)officenet(dot)no&gt;<br />
Senior Software Developer / CTO<br />
------------------------+---------------------------------------------+<br />
OfficeNet AS&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | The most difficult thing in the world is to |<br />
Rosenholmveien 25&nbsp; &nbsp; &nbsp; &nbsp;| know how to do a thing and to watch&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br />
1414 Troll&aring;sen&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | somebody else doing it wrong, without&nbsp; &nbsp; &nbsp; &nbsp;|<br />
NORWAY&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | comment.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br />
Tlf:&nbsp; &nbsp; +47 24 15 38 90 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br />
Fax:&nbsp; &nbsp; +47 24 15 38 91 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br />
Mobile: +47 909&nbsp; 56 963 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br />
------------------------+---------------------------------------------+</span></p>
>From pgsql-jdbc-owner(at)postgresql(dot)org Thu Jan 6 04:59:25 2011
Received: from maia.hub.org (maia-2.hub.org [200.46.204.251])
by mail.postgresql.org (Postfix) with ESMTP id 5A26A1337B9C
for <pgsql-jdbc-postgresql(dot)org(at)mail(dot)postgresql(dot)org>; Thu, 6 Jan 2011 04:59:25 -0400 (AST)
Received: from mail.postgresql.org ([200.46.204.86])
by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024)
with ESMTP id 34584-05 for <pgsql-jdbc-postgresql(dot)org(at)mail(dot)postgresql(dot)org>;
Thu, 6 Jan 2011 08:59:16 +0000 (UTC)
X-Greylist: delayed 00:06:37.032732 by SQLgrey-1.7.6
Received: from web110406.mail.gq1.yahoo.com (web110406.mail.gq1.yahoo.com [67.195.8.230])
by mail.postgresql.org (Postfix) with SMTP id BFE6C1337B96
for <pgsql-jdbc(at)postgresql(dot)org>; Thu, 6 Jan 2011 04:59:15 -0400 (AST)
Received: (qmail 95548 invoked by uid 60001); 6 Jan 2011 08:52:35 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1294303955; bh=6ZHMAOzq31Ej16riPKLTkjwRRNENDH4E1Xo30gn8iQE=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=DPjmFA92FuGE/X/g09fsoCXfq2Jwbrdnli+AqVt31h0UMlWiyzumHbfHlU4vnJ1m8uOG93X+E0BQJQCh+C8TLuA34oEht3YjgSvaHuJROO17EDvO6kbIJ0dpvpq0oaDBSGR9bWwe81hTFhGokxC0MD9eFUHlfIDV/pGa8cUNcUQ=
DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws;
s=s1024; d=yahoo.com;
h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type;
b=Qfnpz076iYcuk4CyQaHoqBHdSLzxFr9Nc+aBY1Aj5uqbXV1OntkzSpJqk8NdsxowL+X4itZWOF7OnNOptfHz3InEXdXAh8Ga/xE9ISAYCi6fEZg8D7yhkjM8ZpHm1qxDcq1D3HIws3x9mDzIObc8dyqUuIrpspkAPIaqtBaP51I=;
Message-ID: <416690(dot)93407(dot)qm(at)web110406(dot)mail(dot)gq1(dot)yahoo(dot)com>
X-YMail-OSG: qaEbz5AVM1k027F6nJFIAhgnXthqvizh34R7p5GrdTVcbFH
EbUTHWgqbdAzhJTGDn98aMFYSLpYpxTzY1nDel00DnFRqCohYmXHerXAQPc_
zj.p_1.vdf6VtW79DaRr0JmbxfVPGTz8n6RuFxVlrLUn..7sKZ84uKhlPjYm
FLnykJnGEGAP7_RHRwkfJf_v23CUwKNpa2J8FrsP.MdPAcqxI3vng0DIZbEO
mu.Qb27Dypc5_cFwF0lPDSkViPiA6hsj5avP12QGG5KR9AwHkeKUisEP52dA
xWUgPyJWYH0vmeL95LgWwDbVBTOrXzmyWxCdg_DzttSaKaxnxK4Mkx1paucv
NmH0V4HSIfbXItfLv6ZuiHZirM6ROEEL7oBLhCIc6mWTOT9.7Ch1KVRJhXh1
Jm9bxFNVKc88-
Received: from [119.152.52.105] by web110406.mail.gq1.yahoo.com via HTTP; Thu, 06 Jan 2011 00:52:34 PST
X-Mailer: YahooMailRC/553 YahooMailWebService/0.8.107.285259
Date: Thu, 6 Jan 2011 00:52:34 -0800 (PST)
From: Altaf Malik <mmalik_altaf(at)yahoo(dot)com>
Subject: Strange behaviour of rs.getTimestamp
To: pgsql-jdbc(at)postgresql(dot)org
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="0-532654577-1294303954=:93407"
X-Virus-Scanned: Maia Mailguard 1.0.1
X-Spam-Status: No, hits=-1.897 tagged_above=-10 required=5
tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001,
RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001, T_RP_MATCHES_RCVD=-0.01,
T_TO_NO_BRKTS_FREEMAIL=0.01
X-Spam-Level:
X-Archive-Number: 201101/9
X-Sequence-Number: 21341

--0-532654577-1294303954=:93407
Content-Type: text/plain; charset=us-ascii

Hello everyone,
I am getting a strange behaviour from rs.getTimestamp() with two specific
dates. Please consider the following test case.

Statement stmt = con.createStatement();
stmt.executeUpdate("create table ts_test(a timestamp)");
stmt.executeUpdate("insert into ts_test values('15-APR-09');");
ResultSet rs = stmt.executeQuery("select * from ts_test");
while (rs.next()) {
Timestamp t = rs.getTimestamp(1);
System.out.println(rs.getString(1)+"->"+ t);
}
stmt.executeUpdate("drop table ts_test");

If you run this test case, I get : 2009-04-15 00:00:00->2009-04-15 01:00:00.0
Please note the values obtained from rs.getString and rs.getTimestamp are
different. I get correct values if I run the same test case against JDK 1.5
(However I have noticed the same behaviour on some of the JDK 1.5's on our
network)

This behaviour is for values 15 April 2009 and 1st June 2009. If I change the
year or date, it works just fine. It is not because of Daylight Savings settings
because on the very next day or the previous day, the value is correct. Is there
something needs to be fixed in Driver or it is the JDK causing the problem?

Regards,
Altaf Malik


--0-532654577-1294303954=:93407
Content-Type: text/html; charset=us-ascii

<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:10pt;color:#000000;">Hello everyone,<br>&nbsp;I am getting a strange behaviour from rs.getTimestamp() with two specific dates. Please consider the following test case.<br><br style="color: rgb(0, 0, 191);"><span style="color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Statement stmt = con.createStatement();</span><br style="color: rgb(0, 0, 191);"><span style="color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stmt.executeUpdate("create table ts_test(a timestamp)");</span><br style="color: rgb(0, 0, 191);"><span style="color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stmt.executeUpdate("insert into ts_test values('15-APR-09');");</span><br style="color: rgb(0, 0, 191);"><span style="color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ResultSet
rs = stmt.executeQuery("select * from&nbsp; ts_test");</span><br style="color: rgb(0, 0, 191);"><span style="color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (rs.next()) {</span><br style="color: rgb(0, 0, 191);"><span style="color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Timestamp t = rs.getTimestamp(1);</span><br style="color: rgb(0, 0, 191);"><span style="color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(rs.getString(1)+"-&gt;"+ t);</span><br style="color: rgb(0, 0, 191);"><span style="color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br style="color: rgb(0, 0, 191);"><span style="color: rgb(0, 0, 191);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stmt.executeUpdate("drop table ts_test");</span><br><br>If you run this test case, I get : 2009-04-15 00:00:00-&gt;2009-04-15 01:00:00.0<br>Please note the
values obtained from rs.getString and rs.getTimestamp are different. I get correct values if I run the same test case against JDK 1.5 (However I have noticed the same behaviour on some of the JDK 1.5's on our network)<br><br>This behaviour is for values 15 April 2009 and 1st June 2009. If I change the year or date, it works just fine. It is not because of Daylight Savings settings because on the very next day or the previous day, the value is correct. Is there something needs to be fixed in Driver or it is the JDK causing the problem?<br><br>Regards,<br>Altaf Malik<br></div><br>

</body></html>
--0-532654577-1294303954=:93407--

Attachment Content-Type Size
unknown_filename text/html 8.8 KB

Browse pgsql-jdbc by date

  From Date Subject
Next Message shubhadeep chattopadhyay 2011-01-06 11:13:59 port problem
Previous Message Albretch Mueller 2011-01-04 01:09:14 Re: making postgresql "source" its data feed from external csv file ...