[libpostgresql-jdbc-java] 02/19: backpatch for driver threadsafe problems

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:19:07 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to tag REL7_4_1
in repository libpostgresql-jdbc-java.

commit 9b4a2a9f775448f97c0c17c6d9139aa76ef547b6
Author: Dave Cramer <davec at fastcrypt.com>
Date:   Fri Dec 5 21:22:03 2003 +0000

    backpatch for driver threadsafe problems
---
 org/postgresql/Driver.java.in | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/org/postgresql/Driver.java.in b/org/postgresql/Driver.java.in
index 7fad468..f1d4754 100644
--- a/org/postgresql/Driver.java.in
+++ b/org/postgresql/Driver.java.in
@@ -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" };
 
 	/*
@@ -382,7 +381,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");
 	}
@@ -390,7 +389,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@"));
 	}
@@ -398,21 +397,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
@@ -426,7 +416,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
 	*/

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git



More information about the pkg-java-commits mailing list