Revision 753
Added by harris over 23 years ago
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 getDateFunction(); |
|
67 |
public abstract String getDateTimeFunction();
|
|
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.getDateFunction(); |
|
112 |
String date = dbAdapterObj.getDateTimeFunction();
|
|
113 | 113 |
|
114 | 114 |
Connection conn = util.openDBConnection(); |
115 | 115 |
long uniqueid = dbAdapterObj.getUniqueID(conn, "xml_catalog"); |
... | ... | |
122 | 122 |
} |
123 | 123 |
|
124 | 124 |
} |
125 |
|
|
125 |
|
src/edu/ucsb/nceas/dbadapter/DBPostgresql.java | ||
---|---|---|
67 | 67 |
* |
68 | 68 |
* @return return the current date and time function name: "now()::date" |
69 | 69 |
*/ |
70 |
public String getDateFunction() { |
|
70 |
public String getDateTimeFunction() {
|
|
71 | 71 |
|
72 | 72 |
//System.out.println("The date and time function: " + "now()::date"); |
73 |
return "now()::date"; |
|
73 |
//to return just the date use now()::date and for the time |
|
74 |
//use now()::time |
|
75 |
return "now()"; |
|
74 | 76 |
} |
75 | 77 |
|
76 | 78 |
/** |
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 getDateFunction() { |
|
69 |
public String getDateTimeFunction() {
|
|
70 | 70 |
|
71 | 71 |
//System.out.println("The date and time function: " + "sysdate"); |
72 | 72 |
return "sysdate"; |
... | ... | |
83 | 83 |
} |
84 | 84 |
|
85 | 85 |
} |
86 |
|
|
86 |
|
Also available in: Unified diff
changed the getDate method to getDateTime and changed the return
string in the postgresql implementation to "now()" from now()::date