Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 2FA3E63264C for ; Sat, 30 Jan 2010 09:35:42 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 18233-06 for ; Sat, 30 Jan 2010 13:35:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mail.postgresql.org (Postfix) with SMTP id 1388263220D for ; Sat, 30 Jan 2010 09:35:30 -0400 (AST) Received: (qmail invoked by alias); 30 Jan 2010 13:35:26 -0000 Received: from cm180.sigma72.maxonline.com.sg (EHLO [192.168.1.100]) [218.212.72.180] by mail.gmx.net (mp035) with SMTP; 30 Jan 2010 14:35:26 +0100 X-Authenticated: #592960 X-Provags-ID: V01U2FsdGVkX19kzlgDlRhkusIZL4DaMPCPtxaa7OOwn/y5Wsnm8E ZmK4RzPwYHf4E/ Message-ID: <4B643598.4060001@gmx.de> Date: Sat, 30 Jan 2010 21:35:20 +0800 From: Sven Hafner User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: Is there a schema parameter for the jdbc URL ? References: <4B639C25.5060501@gmx.de> <895e58dd1001300223g726914fdtd76df34873e2f43a@mail.gmail.com> In-Reply-To: <895e58dd1001300223g726914fdtd76df34873e2f43a@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.51000000000000001 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201001/83 X-Sequence-Number: 20279 Thanks I came across the same old post (which goes back as far as 2002..) I use the search_path feature as well. Scenario A: 2 web applications using the same EJB (which has a fix user to access the DB) want to access same db instance but different schema, like 2 customer use 2 instances of same webapp sharing DB (split in 2 schema) (using different jndi/jdbc names could access different schema) Scenario B: for a major DB migration could keep the old tables online in schema 1 and migrate data into schema 2. could easily fall back if migration fails (just by pointing jndi names forth and back) Sven Maciek Sakrejda wrote: > There's no way to do this just in the URL. There's been patches > submitted to add this[1], but there have been some objections. I don't > quite understand what you are trying to do, but if you have access to > the connection after it's created and before it's used, you can > execute "set search_path" for the session. > > [1]: Most recent I found is discussed here: > http://archives.postgresql.org/pgsql-jdbc/2008-07/msg00012.php > --- > Maciek Sakrejda | Software Engineer | Truviso > > 1065 E. Hillsdale Blvd., Suite 230 > Foster City, CA 94404 > (650) 242-3500 Main > (650) 242-3501 F > www.truviso.com > > > On Fri, Jan 29, 2010 at 6:40 PM, Sven Hafner > wrote: > > Hi ! > > Asked the same question previously in the Glassfish forum, but I > dont get it to work. Not sure if it is a GF or postgres jdbc > issue/feature. > > Can I use the schema in the jdbc URL ? > > My GF mailing-list question for reference: > I create a connection pool and connection pointing to a PostgreSQL DB. > Is there a way to point to a specific schema inside the DB (like a > schema parameter) ? I need to avoid a schema annotation inside the > EJB code, so I can point several instances of the same application > (but different PU pointing to different jndi jdbc resource) > to different schemes in the same postgres instance. > > Glassfish V3 and PostgreSQL 8.4 > postgresql-8.4-701.jdbc3.jar > > Thanks for input > Sven > > -- > Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org > ) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-jdbc > >