Project

General

Profile

« Previous | Next » 

Revision 6551

use logging, not system.out

View differences:

src/edu/ucsb/nceas/metacat/admin/upgrade/UpgradeNodeDataDatetime.java
38 38

  
39 39
import javax.xml.bind.DatatypeConverter;
40 40

  
41
import org.apache.commons.logging.Log;
42
import org.apache.commons.logging.LogFactory;
43

  
41 44
import edu.ucsb.nceas.metacat.admin.AdminException;
42 45
import edu.ucsb.nceas.metacat.properties.PropertyService;
43 46
import edu.ucsb.nceas.utilities.SortedProperties;
44 47

  
45 48
public class UpgradeNodeDataDatetime implements UpgradeUtilityInterface {
46 49

  
50
	protected static Log log = LogFactory.getLog(UpgradeNodeDataDatetime.class);
51
	
47 52
    private String driver = null;
48 53
    private String url = null;
49 54
    private String user = null;
......
110 115
		                    pstmt.execute();
111 116
		                    //pstmt.close();
112 117

  
113
		                    System.out.println("processed: " + nodedata);
118
		                    log.debug("processed: " + nodedata);
114 119
		                    count++;
115 120
		                    if (count%5 == 0) {
116
		                        System.out.println(count + "...");
121
		                        log.debug(count + "...");
117 122
		                    }
118 123
		            		
119 124
		                }
......
124 129
		            	pstmt.close();
125 130
		            }
126 131
		        }
127
		        System.out.println("Table: " + tableName + " complete. " + count + " values converted.");
132
		        log.warn("Table: " + tableName + " complete. " + count + " values converted.");
128 133
		
129 134
		        rset.close();
130 135
		        sqlStatement.close();
131 136
	        sqlca.close();
132 137
    	} catch (Exception e) {
133
    		e.printStackTrace();
134
            throw new AdminException("Error upgrading system to 2.0.0: " + e.getMessage());
138
    		String msg = "Error updating date time node data: " + e.getMessage();
139
    		log.error(msg, e);
140
            throw new AdminException(msg);
135 141
        }
136 142
    	return true;
137 143
    }

Also available in: Unified diff