Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 03BD113C699A for ; Fri, 4 May 2012 15:00:21 -0300 (ADT) Received: from mail209.messagelabs.com ([216.82.255.3]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SQMni-0006FS-9t for pgsql-jdbc@postgresql.org; Fri, 04 May 2012 18:00:20 +0000 X-Env-Sender: skong@investoranalytics.com X-Msg-Ref: server-10.tower-209.messagelabs.com!1336154402!4805923!8 X-Originating-IP: [216.166.12.31] X-StarScan-Version: 6.5.7; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8247 invoked from network); 4 May 2012 18:00:05 -0000 Received: from out001.collaborationhost.net (HELO out001.collaborationhost.net) (216.166.12.31) by server-10.tower-209.messagelabs.com with RC4-SHA encrypted SMTP; 4 May 2012 18:00:05 -0000 Received: from AUSP01VMBX04.collaborationhost.net ([10.2.8.80]) by AUSP01MHUB01.collaborationhost.net ([10.2.8.25]) with mapi; Fri, 4 May 2012 13:00:01 -0500 From: Shijun Kong To: Dave Cramer CC: "pgsql-jdbc@postgresql.org" Date: Fri, 4 May 2012 12:59:58 -0500 Subject: Re: PGSimpleDataSource not support jdbc url Thread-Topic: [JDBC] PGSimpleDataSource not support jdbc url Thread-Index: Ac0qH7naKLm6x3l8TOi3l8LX+ps6Zg== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.1.120420 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201205/8 X-Sequence-Number: 22908 When go DriverManager approach, we can do something like: (http://jdbc.postgresql.org/documentation/80/connect.html) String url =3D=20 "jdbc:postgresql://localhost/test?user=3Dfred&password=3Dsecret&ssl=3Dtrue"= ; Connection conn =3D DriverManager.getConnection(url); However, if you want to use javax.sql.DataSource approach instead of DriverManager, the current implementation in PGSimpleDataSource(I am using 8.4, looks like 9.x has the same API) force you providing serverName, PortNumber, databaseName, user, password one by one via setter methods. Sure, you can parse a jdbc url to get all these properties and set them one by one. But prefer a jdbc driver library can do that for end-users which could save boilerplate code for everyone. On 5/4/12 1:52 PM, "Dave Cramer" wrote: >Shijun, > >Can you be more specific ? > >Dave Cramer > >dave.cramer(at)credativ(dot)ca >http://www.credativ.ca > > >On Fri, May 4, 2012 at 1:46 PM, Shijun Kong >wrote: >> Hi, >> >> I am new to postgreSQL, pgsql-jdbc. If I am not mistaken, >>PGSimpleDataSource >> does not support jdbc url. Is there any plan to implement it in future? >> >> __________________________ >> Shijun Kong, Software Developer >> Investor Analytics - Risk Transparency >> >> Direct: +1 646.553.4510 x 121 >> Shijun.Kong@investoranalytics.com >> www.investoranalytics.com >> >> www.riskology.com