Project

General

Profile

« Previous | Next » 

Revision 751

Added by bojilova over 23 years ago

change the method name getDateString() to getDateFunction()
return "now()::date" in the DBPostgresql implementation of that method

View differences:

src/edu/ucsb/nceas/dbadapter/DBAdapter.java
64 64
   *
65 65
   * @return return the current date and time function name
66 66
   */
67
  public abstract String getDateString();
67
  public abstract String getDateFunction();
68 68

  
69 69
  /**
70 70
   * The character that the specific database implementation uses to 
......
109 109
      DBAdapter dbAdapterObj = (DBAdapter)createObject(dbAdapter);
110 110
      
111 111
      // test if they work correctly
112
      String date = dbAdapterObj.getDateString();
112
      String date = dbAdapterObj.getDateFunction();
113 113

  
114 114
      Connection conn = util.openDBConnection();
115 115
      long uniqueid = dbAdapterObj.getUniqueID(conn, "xml_catalog");
src/edu/ucsb/nceas/dbadapter/DBPostgresql.java
1 1
/**
2 2
 *  '$RCSfile$'
3
 *    Purpose: A db adapter class for Postgresql RDBMS.
3
 *    Purpose: A db adapter class for PostgreSQL RDBMS.
4 4
 *  Copyright: 2000 Regents of the University of California and the
5 5
 *             National Center for Ecological Analysis and Synthesis
6 6
 *    Authors: Jivka Bojilova
......
30 30
import java.sql.*;
31 31

  
32 32
/**
33
 * The Oracle db adapter implementation.
33
 * The PostgreSQL db adapter implementation.
34 34
 */
35 35
public class DBPostgresql extends DBAdapter {
36 36

  
37 37
  /**
38
   * The Postgresql unique ID /sequence generator
38
   * The PostgreSQL unique ID /sequence generator
39 39
   * The name of the sequence used to generate the unique id 
40 40
   * is made from the name of the table that uses the id by 
41 41
   * appending "_id_seq" to it.
......
62 62
  }
63 63

  
64 64
  /**
65
   * The Postgresql function name that gets the current date 
66
   * from the database server
65
   * The PostgreSQL function name that gets the current date 
66
   * and time from the database server
67 67
   *
68
   * @return return the current date and time function name: "sysdate"
68
   * @return return the current date and time function name: "now()::date"
69 69
   */
70
  public String getDateString() {
70
  public String getDateFunction() {
71 71

  
72
    //System.out.println("Current date string: " + "sysdate");    
73
    return "current_date";
74
		//for current time use current_time
72
    //System.out.println("The date and time function: " + "now()::date");    
73
    return "now()::date";
75 74
  }
76 75

  
77 76
  /**
78
   * Postgresql's string delimiter character: single quote (')
77
   * PostgreSQL's string delimiter character: single quote (')
79 78
   *
80 79
   * @return return the string delimiter: single quote (')
81 80
   */
src/edu/ucsb/nceas/dbadapter/DBOracle.java
66 66
   *
67 67
   * @return return the current date and time function name: "sysdate"
68 68
   */
69
  public String getDateString() {
69
  public String getDateFunction() {
70 70

  
71
    //System.out.println("Current date string: " + "sysdate");    
71
    //System.out.println("The date and time function: " + "sysdate");    
72 72
    return "sysdate";
73 73
  }
74 74

  

Also available in: Unified diff