Index: trunk/lucene-search/org/wikimedia/lsearch/DatabaseConnection.java |
— | — | @@ -63,6 +63,15 @@ |
64 | 64 | if (config.getString("mwsearch.dburl") == null) { |
65 | 65 | throw(new SQLException("You must set mwsearch.dburl in the config file. Aborting...")); |
66 | 66 | } |
| 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 | + } |
67 | 76 | String dburl = MessageFormat.format(config.getString("mwsearch.dburl"), |
68 | 77 | new Object[] { config.getString("mwsearch.database.host"), dbname }); |
69 | 78 | Connection dbconn = DriverManager.getConnection(dburl, |