Specification of "/" in the host name (for Unix socket support)

From: Deepak Bhole <dbhole(at)redhat(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Cc: Fernando Nasser <fnasser(at)redhat(dot)com>
Subject: Specification of "/" in the host name (for Unix socket support)
Date: 2003-09-12 19:20:49
Message-ID: 1063394449.10113.2.camel@tomacco.toronto.redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


Hi,

We are trying to add support for Unix sockets to the current jdbc (for
our own release for now). The support is added via gnu classpath,located
at: http://www.nfrese.net/software/gnu_net_local/overview.html

Since Unix sockets require specification of path to the socket, the url
would be something like: jdbc:postgresql:///tmp:5432/template1...

However, since the path starts with a "/" which is a token separator,
parseURL in Driver.java cannot handle it, and sets the host to "/". To
find possible solutions, we referred to the URL RFC located at:
http://www.w3.org/Addressing/rfc1738.txt

Section 5, the BNF mentions that "% <hex> <hex>" is an escaped
character. We are thinking of implementing a similar idea for the jdbc
url. i.e. the URL jdbc:postgresql:///tmp:5432/template1... would have to
be specified as jdbc:postgresql://%2Ftmp:5432/template1... , 2F being
the ascii code for "/" in hex. This would of course necessitate the
addition of an extra function for parsing tokens but it would be fairly
simple to implement.

Does the above mentioned approach seem reasonable or is there another
format that should be followed?

Thanks,
Deepak

--
Deepak Bhole <dbhole(at)redhat(dot)com>
Red Hat Canada Ltd.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Paul Thomas 2003-09-12 22:23:56 Re: Specification of "/" in the host name (for Unix socket support)
Previous Message Kevin Schroeder 2003-09-12 16:50:20 JDBC Streaming large objects