Revision 543
Added by berkley about 24 years ago
src/edu/ucsb/nceas/metacat/ReplicationHandler.java | ||
---|---|---|
18 | 18 |
import java.lang.Thread; |
19 | 19 |
import java.io.*; |
20 | 20 |
import java.net.*; |
21 |
import java.text.*; |
|
21 | 22 |
import org.xml.sax.AttributeList; |
22 | 23 |
import org.xml.sax.ContentHandler; |
23 | 24 |
import org.xml.sax.DTDHandler; |
... | ... | |
172 | 173 |
System.out.println("newDocid: " + newDocid + " " + action + "ED"); |
173 | 174 |
} |
174 | 175 |
} |
175 |
//update the last_update field for each server to the current date/time |
|
176 |
|
|
177 |
//update the last_update field for each server to the current date/time |
|
178 |
SimpleDateFormat formatter = new SimpleDateFormat ("yy-MM-dd HH:mm:ss"); |
|
179 |
java.util.Date newDate = new java.util.Date(System.currentTimeMillis()); |
|
180 |
ParsePosition pos = new ParsePosition(0); |
|
181 |
String dateString = formatter.format(newDate); |
|
182 |
//System.out.println("dateString: " + dateString); |
|
183 |
StringBuffer sql = new StringBuffer(); |
|
184 |
sql.append("update xml_replication set last_checked = to_date('"); |
|
185 |
sql.append(dateString).append("', 'YY-MM-DD HH24:MI:SS')"); |
|
186 |
System.out.println("sql: " + sql.toString()); |
|
187 |
pstmt = conn.prepareStatement(sql.toString()); |
|
188 |
pstmt.executeUpdate(); |
|
189 |
//conn.commit(); |
|
190 |
System.out.println("last_checked updated: " + dateString); |
|
176 | 191 |
|
177 |
|
|
178 | 192 |
} |
179 | 193 |
catch(Exception e) |
180 | 194 |
{ |
Also available in: Unified diff
now updates the xml_replication last_checked field