diff options
author | Dave Cramer <davec@fastcrypt.com> | 2003-12-11 18:10:40 +0000 |
---|---|---|
committer | Dave Cramer <davec@fastcrypt.com> | 2003-12-11 18:10:40 +0000 |
commit | 742ca2e05798c9824ada4486873d5b239ee6f27c (patch) | |
tree | 0c6d330c5eab13b1012749fbe4eabe1bd9da9269 /src | |
parent | fc1dc0cd332aa277856827027aeddc27c34d7cb0 (diff) | |
download | postgresql-742ca2e05798c9824ada4486873d5b239ee6f27c.tar.gz postgresql-742ca2e05798c9824ada4486873d5b239ee6f27c.zip |
build number set to 300 to avoid conflict with 7.4 builds
threadsafe patch from Karl von Randow applied
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/Driver.java.in | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/Driver.java.in b/src/interfaces/jdbc/org/postgresql/Driver.java.in index 6beb2582f82..2e95bb748c8 100644 --- a/src/interfaces/jdbc/org/postgresql/Driver.java.in +++ b/src/interfaces/jdbc/org/postgresql/Driver.java.in @@ -6,7 +6,7 @@ * Copyright (c) 2003, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/jdbc/org/postgresql/Driver.java.in,v 1.39 2003/12/10 18:30:44 davec Exp $ + * $PostgreSQL: pgsql/src/interfaces/jdbc/org/postgresql/Driver.java.in,v 1.40 2003/12/11 18:10:40 davec Exp $ * *------------------------------------------------------------------------- */ @@ -123,6 +123,7 @@ public class Driver implements java.sql.Driver */ public java.sql.Connection connect(String url, Properties info) throws SQLException { + Properties props; if ((props = parseURL(url, info)) == null) { if (Driver.logDebug) @@ -135,7 +136,7 @@ public class Driver implements java.sql.Driver Driver.debug("connect " + url); @JDBCCONNECTCLASS@ con = (@JDBCCONNECTCLASS@)(Class.forName("@JDBCCONNECTCLASS@").newInstance()); - con.openConnection (host(), port(), props, database(), url, this); + con.openConnection (host(props), port(props), props, database(props), url, this); return (java.sql.Connection)con; } catch (ClassNotFoundException ex) @@ -247,8 +248,6 @@ public class Driver implements java.sql.Driver return false; } - private Properties props; - static private String[] protocols = { "jdbc", "postgresql" }; /* @@ -386,7 +385,7 @@ public class Driver implements java.sql.Driver /* * @return the hostname portion of the URL */ - public String host() + public String host(Properties props) { return props.getProperty("PGHOST", "localhost"); } @@ -394,7 +393,7 @@ public class Driver implements java.sql.Driver /* * @return the port number portion of the URL or the default if no port was specified */ - public int port() + public int port(Properties props) { return Integer.parseInt(props.getProperty("PGPORT", "@DEF_PGPORT@")); } @@ -402,21 +401,12 @@ public class Driver implements java.sql.Driver /* * @return the database name of the URL */ - public String database() + public String database(Properties props) { return props.getProperty("PGDBNAME", ""); } /* - * @return the value of any property specified in the URL or properties - * passed to connect(), or null if not found. - */ - public String property(String name) - { - return props.getProperty(name); - } - - /* * This method was added in v6.5, and simply throws an SQLException * for an unimplemented method. I decided to do it this way while * implementing the JDBC2 extensions to JDBC, as it should help keep the @@ -430,7 +420,7 @@ public class Driver implements java.sql.Driver /** * used to turn logging on to a certain level, can be called * by specifying fully qualified class ie org.postgresql.Driver.setLogLevel() - * @param int logLevel sets the level which logging will respond to + * @param logLevel sets the level which logging will respond to * INFO being almost no messages * DEBUG most verbose */ @@ -508,6 +498,6 @@ public class Driver implements java.sql.Driver //The build number should be incremented for every new build - private static int m_buildNumber = 211; + private static int m_buildNumber = 300; } |