Mercurial > hg > monetdb-java
comparison src/main/java/org/monetdb/jdbc/MonetDriver.java @ 788:2f36ac68ac35 monetdbs
Get rid of MONETURL constant
it has two uses which are going to be changed in different ways
author | Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com> |
---|---|
date | Fri, 17 Nov 2023 14:45:40 +0100 (17 months ago) |
parents | f7df78989ac5 |
children | 5bfe3357fb1c |
comparison
equal
deleted
inserted
replaced
787:e349d8272a13 | 788:2f36ac68ac35 |
---|---|
40 * @author Fabian Groffen | 40 * @author Fabian Groffen |
41 */ | 41 */ |
42 public final class MonetDriver implements Driver { | 42 public final class MonetDriver implements Driver { |
43 // the url kind will be jdbc:monetdb://<host>[:<port>]/<database> | 43 // the url kind will be jdbc:monetdb://<host>[:<port>]/<database> |
44 // Chapter 9.2.1 from Sun JDBC 3.0 specification | 44 // Chapter 9.2.1 from Sun JDBC 3.0 specification |
45 /** The prefix of a MonetDB url */ | |
46 static final String MONETURL = "jdbc:monetdb://"; | |
47 | 45 |
48 // initialize this class: register it at the DriverManager | 46 // initialize this class: register it at the DriverManager |
49 // Chapter 9.2 from Sun JDBC 3.0 specification | 47 // Chapter 9.2 from Sun JDBC 3.0 specification |
50 static { | 48 static { |
51 try { | 49 try { |
65 * @param url the URL of the database | 63 * @param url the URL of the database |
66 * @return true if this driver understands the given URL; false otherwise | 64 * @return true if this driver understands the given URL; false otherwise |
67 */ | 65 */ |
68 @Override | 66 @Override |
69 public boolean acceptsURL(final String url) { | 67 public boolean acceptsURL(final String url) { |
70 return url != null && url.startsWith(MONETURL); | 68 return url != null && url.startsWith("jdbc:monetdb://"); |
71 } | 69 } |
72 | 70 |
73 /** | 71 /** |
74 * Attempts to make a database connection to the given URL. The driver | 72 * Attempts to make a database connection to the given URL. The driver |
75 * should return "null" if it realizes it is the wrong kind of driver to | 73 * should return "null" if it realizes it is the wrong kind of driver to |