|
6 | 6 | * Copyright (c) 2003, PostgreSQL Global Development Group
|
7 | 7 | *
|
8 | 8 | * IDENTIFICATION
|
9 |
| - * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/Driver.java.in,v 1.36 2003/09/13 04:02:12 barry Exp $ |
| 9 | + * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Attic/Driver.java.in,v 1.37 2003/11/03 15:22:06 davec Exp $ |
10 | 10 | *
|
11 | 11 | *-------------------------------------------------------------------------
|
12 | 12 | */
|
@@ -111,7 +111,7 @@ public class Driver implements java.sql.Driver
|
111 | 111 | *
|
112 | 112 | * Our protocol takes the forms:
|
113 | 113 | * <PRE>
|
114 |
| - * jdbc:org.postgresql://host:port/database?param1=val1&... |
| 114 | + * jdbc:postgresql://host:port/database?param1=val1&... |
115 | 115 | * </PRE>
|
116 | 116 | *
|
117 | 117 | * @param url the URL of the database to connect to
|
@@ -163,7 +163,7 @@ public class Driver implements java.sql.Driver
|
163 | 163 | * Returns true if the driver thinks it can open a connection to the
|
164 | 164 | * given URL. Typically, drivers will return true if they understand
|
165 | 165 | * the subprotocol specified in the URL and false if they don't. Our
|
166 |
| - * protocols start with jdbc:org.postgresql: |
| 166 | + * protocols start with jdbc:postgresql: |
167 | 167 | *
|
168 | 168 | * @see java.sql.Driver#acceptsURL
|
169 | 169 | * @param url the URL of the driver
|
@@ -286,7 +286,8 @@ public class Driver implements java.sql.Driver
|
286 | 286 |
|
287 | 287 | //parse the server part of the url
|
288 | 288 | StringTokenizer st = new StringTokenizer(l_urlServer, ":/", true);
|
289 |
| - for (int count = 0; (st.hasMoreTokens()); count++) |
| 289 | + int count; |
| 290 | + for (count = 0; (st.hasMoreTokens()); count++) |
290 | 291 | {
|
291 | 292 | String token = st.nextToken();
|
292 | 293 |
|
@@ -357,14 +358,17 @@ public class Driver implements java.sql.Driver
|
357 | 358 | }
|
358 | 359 | }
|
359 | 360 | }
|
| 361 | + if (count <= 1) { |
| 362 | + return null; |
| 363 | + } |
360 | 364 |
|
361 | 365 | // if we extracted an IPv6 address out earlier put it back
|
362 | 366 | if (ipv6address != null)
|
363 | 367 | urlProps.put("PGHOST",ipv6address);
|
364 | 368 |
|
365 | 369 | //parse the args part of the url
|
366 | 370 | StringTokenizer qst = new StringTokenizer(l_urlArgs, "&");
|
367 |
| - for (int count = 0; (qst.hasMoreTokens()); count++) |
| 371 | + for (count = 0; (qst.hasMoreTokens()); count++) |
368 | 372 | {
|
369 | 373 | String token = qst.nextToken();
|
370 | 374 | int l_pos = token.indexOf('=');
|
|
0 commit comments