Peter Mount writes:
> > > So far our standard has been to use 5432 if no port is supplied.
> >
> >It's still this way. As I said, only people that use configure
> >--with-pgport see any change, and those people know what they're getting
> >into.
>
> Perhaps a message saying this (or even in the version strings within JDBC).
Version string sounds okay. A message during the build would probably get
lost.
How about this patch:
diff -u -r1.5 Driver.java.in
--- Driver.java.in 2001/03/11 11:07:01 1.5
+++ Driver.java.in 2001/03/14 21:47:09
@@ -214,7 +214,13 @@
*/
public static String getVersion()
{
- return "@VERSION@";
+ String version = "@VERSION@";
+ String defport = defaultPort();
+
+ if (defport == "5432")
+ return version;
+ else
+ return version + " (default port " + defport + ")";
}
/**
@@ -350,8 +356,13 @@
* @return the port number portion of the URL or -1 if no port was specified
*/
public int port()
+ {
+ return Integer.parseInt(props.getProperty("PGPORT", defaultPort()));
+ }
+
+ private String defaultPort()
{
- return Integer.parseInt(props.getProperty("PGPORT","@DEF_PGPORT@"));
+ return "@DEF_PGPORT@";
}
/**
--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/