Project

General

Profile

« Previous | Next » 

Revision 2132

Added by Duane Costa over 20 years ago

Replace Harvester dbDriver property with database property

View differences:

lib/harvester/harvester.properties
1 1
connectToMetacat=true
2
dbDriver=oracle.jdbc.driver.OracleDriver
2
database=oracle
3 3
defaultDB=jdbc:oracle:thin:@knb.lternet.edu:1521:knblter
4 4
delay=0
5 5
harvesterAdministrator=dcosta@lternet.edu
src/edu/ucsb/nceas/metacat/harvesterClient/Harvester.java
779 779
   */
780 780
  private void startup(int nHarvests, int maxHarvests) {
781 781
    Boolean ctm;
782
    String dbDriver;
782
    String database;
783
    String dbDriver = "";
783 784
		String defaultDB;
784 785
    Integer lp;
785 786
    String metacatURL;
......
802 803
    properties = Harvester.properties;
803 804
    ctm = Boolean.valueOf(properties.getProperty("connectToMetacat", "true"));
804 805
    connectToMetacat = ctm.booleanValue();
805
    dbDriver = properties.getProperty("dbDriver");
806
    database = properties.getProperty("database");
807
    
808
    if (database.equalsIgnoreCase("oracle")) {
809
      dbDriver = "oracle.jdbc.driver.OracleDriver";
810
    }
811
    else if (database.equalsIgnoreCase("postgresql")) {
812
      dbDriver = "org.postgresql.Driver";
813
    }
814
    else if (database.equalsIgnoreCase("sqlserver")) {
815
      dbDriver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
816
    }
817

  
806 818
    harvesterAdministrator = properties.getProperty("harvesterAdministrator");
807 819

  
808 820
    try {
src/edu/ucsb/nceas/metacat/harvesterClient/HarvesterRegistration.java
686 686
   * @throws ServletException
687 687
   */
688 688
  public void init() throws ServletException {
689
    String dbDriver;
689
    String database;
690
    String dbDriver = "";
690 691
    Properties properties = loadProperties();
691 692

  
692
    dbDriver = properties.getProperty("dbDriver");
693
    database = properties.getProperty("database");
694
    
695
    if (database.equalsIgnoreCase("oracle")) {
696
      dbDriver = "oracle.jdbc.driver.OracleDriver";
697
    }
698
    else if (database.equalsIgnoreCase("postgresql")) {
699
      dbDriver = "org.postgresql.Driver";
700
    }
701
    else if (database.equalsIgnoreCase("sqlserver")) {
702
      dbDriver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
703
    }
704
    
693 705
    defaultDB = properties.getProperty("defaultDB");
694 706
    password = properties.getProperty("password");
695 707
    user = properties.getProperty("user");
docs/user/harvester.html
164 164
          Default: <code>true</code>
165 165
    </tr>
166 166
    <tr>
167
      <td>dbDriver</td>
168
      <td>The JDBC driver to be used to access the backend database. This
169
          setting should match the value of the dbDriver property as set 
170
          in the <a href=../../build.xml>build.xml</a> file as appropriate 
171
          to the database being used (Oracle, PostgreSQL, or SQL Server).
167
      <td>database</td>
168
      <td>The backend database
169
          This setting should match the value of the <code>database</code>
170
          property as set in the 
171
          <a href=../../build.properties>build.properties</a>
172
          file in the associated Metacat installation.
172 173
      </td>
173
      <td>Examples:<br>
174
          <code>oracle.jdbc.driver.OracleDriver</code><br>
175
          <code>org.postgresql.Driver</code><br>
176
          <code>com.microsoft.jdbc.sqlserver.SQLServerDriver</code>
174
      <td><code>oracle | postgresql | sqlserver</code>
177 175
      </td>
178 176
    </tr>
179 177
    <tr>

Also available in: Unified diff