6
6
* Copyright (c) 2003, PostgreSQL Global Development Group
7
7
*
8
8
* IDENTIFICATION
9
- * $PostgreSQL: pgsql/src/interfaces/jdbc/org/postgresql/Driver.java.in,v 1.39 2003/12/10 18:30:44 davec Exp $
9
+ * $PostgreSQL: pgsql/src/interfaces/jdbc/org/postgresql/Driver.java.in,v 1.40 2003/12/11 18:10:40 davec Exp $
10
10
*
11
11
*-------------------------------------------------------------------------
12
12
*/
@@ -123,6 +123,7 @@ public class Driver implements java.sql.Driver
123
123
*/
124
124
public java.sql.Connection connect(String url, Properties info) throws SQLException
125
125
{
126
+ Properties props;
126
127
if ((props = parseURL(url, info)) == null)
127
128
{
128
129
if (Driver.logDebug)
@@ -135,7 +136,7 @@ public class Driver implements java.sql.Driver
135
136
Driver.debug("connect " + url);
136
137
137
138
@JDBCCONNECTCLASS@ con = (@JDBCCONNECTCLASS@)(Class.forName("@JDBCCONNECTCLASS@").newInstance());
138
- con.openConnection (host(), port(), props, database(), url, this);
139
+ con.openConnection (host(props ), port(props ), props, database(props ), url, this);
139
140
return (java.sql.Connection)con;
140
141
}
141
142
catch (ClassNotFoundException ex)
@@ -247,8 +248,6 @@ public class Driver implements java.sql.Driver
247
248
return false;
248
249
}
249
250
250
- private Properties props;
251
-
252
251
static private String[] protocols = { "jdbc", "postgresql" };
253
252
254
253
/*
@@ -386,36 +385,27 @@ public class Driver implements java.sql.Driver
386
385
/*
387
386
* @return the hostname portion of the URL
388
387
*/
389
- public String host()
388
+ public String host(Properties props )
390
389
{
391
390
return props.getProperty("PGHOST", "localhost");
392
391
}
393
392
394
393
/*
395
394
* @return the port number portion of the URL or the default if no port was specified
396
395
*/
397
- public int port()
396
+ public int port(Properties props )
398
397
{
399
398
return Integer.parseInt(props.getProperty("PGPORT", "@DEF_PGPORT@"));
400
399
}
401
400
402
401
/*
403
402
* @return the database name of the URL
404
403
*/
405
- public String database()
404
+ public String database(Properties props )
406
405
{
407
406
return props.getProperty("PGDBNAME", "");
408
407
}
409
408
410
- /*
411
- * @return the value of any property specified in the URL or properties
412
- * passed to connect(), or null if not found.
413
- */
414
- public String property(String name)
415
- {
416
- return props.getProperty(name);
417
- }
418
-
419
409
/*
420
410
* This method was added in v6.5, and simply throws an SQLException
421
411
* for an unimplemented method. I decided to do it this way while
@@ -430,7 +420,7 @@ public class Driver implements java.sql.Driver
430
420
/**
431
421
* used to turn logging on to a certain level, can be called
432
422
* by specifying fully qualified class ie org.postgresql.Driver.setLogLevel()
433
- * @param int logLevel sets the level which logging will respond to
423
+ * @param logLevel sets the level which logging will respond to
434
424
* INFO being almost no messages
435
425
* DEBUG most verbose
436
426
*/
@@ -508,6 +498,6 @@ public class Driver implements java.sql.Driver
508
498
509
499
510
500
//The build number should be incremented for every new build
511
- private static int m_buildNumber = 211 ;
501
+ private static int m_buildNumber = 300 ;
512
502
513
503
}
0 commit comments