Changeset 7534


Ignore:
Timestamp:
Nov 27, 2018, 10:48:41 AM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #2130: Upgrade 3-rd party libraries

The change made in [7521] removed the db.driver setting. It was still used in two JSP pages. They have now been updated to use the DriverManager with the db.url setting instead.

Location:
trunk/www
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/exception/exception.jsp

    r7158 r7534  
    4848  import="javax.servlet.ServletException"
    4949  import="java.sql.Driver"
     50  import="java.sql.DriverManager"
    5051  import="java.util.Properties"
    5152  isErrorPage="true"
     
    102103  }
    103104
    104   final String jdbcDriver = Config.getString("db.driver");
     105  final String dbUrl = Config.getString("db.url");
     106  String driverName = "unknown";
    105107  String driverVersion = "";
    106108  try
    107109  {
    108     final Driver driver = (Driver)Class.forName(jdbcDriver).newInstance();
     110    final Driver driver = DriverManager.getDriver(dbUrl);
     111    driverName = driver.getClass().getName();
    109112    driverVersion = "(version " + driver.getMajorVersion() + "." + driver.getMinorVersion() + ")";
    110113  }
    111114  catch (Throwable t)
    112   {} 
     115  {}
     116
    113117  final Properties properties = System.getProperties();
    114118  final Runtime runtime = Runtime.getRuntime();
     
    140144    <tr>
    141145      <th>JDBC Driver</th>
    142       <td><%=jdbcDriver%> <%=driverVersion%></td>
     146      <td><%=driverName%> <%=driverVersion%></td>
    143147    </tr>
    144148    <tr>
  • trunk/www/info/about.jsp

    r6762 r7534  
    3737  import="net.sf.basedb.util.Values"
    3838  import="java.sql.Driver"
     39  import="java.sql.DriverManager"
    3940  import="java.util.Properties"
    4041  import="java.util.List"
     
    5657final String activePage = request.getParameter("page");
    5758
    58 final String jdbcDriver = Config.getString("db.driver");
     59final String dbUrl = Config.getString("db.url");
     60String driverName = "unknown";
    5961String driverVersion = "";
    6062try
    6163{
    62   final Driver driver = (Driver)Class.forName(jdbcDriver).newInstance();
     64  final Driver driver = DriverManager.getDriver(dbUrl);
     65  driverName = driver.getClass().getName();
    6366  driverVersion = "(version " + driver.getMajorVersion() + "." + driver.getMinorVersion() + ")";
    6467}
     
    143146  <tr>
    144147    <th>JDBC Driver</th>
    145     <td class="info"><%=jdbcDriver%> <%=driverVersion%></td>
     148    <td class="info"><%=driverName%> <%=driverVersion%></td>
    146149  </tr>
    147150  <tr>
Note: See TracChangeset for help on using the changeset viewer.