r7230 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r7229‎ | r7230 | r7231 >
Date:10:56, 22 January 2005
Author:vibber
Status:old
Tags:
Comment:
Add mwsearch.driver property to force-load a class (eg if the VM doesn't support the -Djdbc.drivers property or you think it's ugly)
Modified paths:
  • /trunk/lucene-search/org/wikimedia/lsearch/DatabaseConnection.java (modified) (history)

Diff [purge]

Index: trunk/lucene-search/org/wikimedia/lsearch/DatabaseConnection.java
@@ -63,6 +63,15 @@
6464 if (config.getString("mwsearch.dburl") == null) {
6565 throw(new SQLException("You must set mwsearch.dburl in the config file. Aborting..."));
6666 }
 67+ String driverClass = config.getString("mwsearch.driver");
 68+ if (driverClass != null) {
 69+ try {
 70+ Class.forName(driverClass);
 71+ } catch(ClassNotFoundException e) {
 72+ System.out.println("Couldn't load jdbc driver " +
 73+ driverClass + ": " + e.toString());
 74+ }
 75+ }
6776 String dburl = MessageFormat.format(config.getString("mwsearch.dburl"),
6877 new Object[] { config.getString("mwsearch.database.host"), dbname });
6978 Connection dbconn = DriverManager.getConnection(dburl,

Status & tagging log