removed dead code
This commit is contained in:
		@@ -63,6 +63,7 @@ public class Info {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * print memory utilization
 | 
					     * print memory utilization
 | 
				
			||||||
 | 
					     * todo parse into website somehow
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void getMemoryUsage() {
 | 
					    public static void getMemoryUsage() {
 | 
				
			||||||
        Runtime runtime = Runtime.getRuntime();
 | 
					        Runtime runtime = Runtime.getRuntime();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,13 +1,7 @@
 | 
				
			|||||||
package com.wasteinformationserver.db;
 | 
					package com.wasteinformationserver.db;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.wasteinformationserver.basicutils.Log;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import javax.swing.table.DefaultTableModel;
 | 
					 | 
				
			||||||
import java.sql.Connection;
 | 
					import java.sql.Connection;
 | 
				
			||||||
import java.sql.ResultSet;
 | 
					 | 
				
			||||||
import java.sql.ResultSetMetaData;
 | 
					 | 
				
			||||||
import java.sql.SQLException;
 | 
					import java.sql.SQLException;
 | 
				
			||||||
import java.util.Vector;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
abstract class Database {
 | 
					abstract class Database {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -28,62 +22,4 @@ abstract class Database {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public abstract Connection getConnection() throws SQLException;
 | 
					    public abstract Connection getConnection() throws SQLException;
 | 
				
			||||||
 | 
					 | 
				
			||||||
    public static void logToConsole(ResultSet res) {
 | 
					 | 
				
			||||||
        try {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            ResultSetMetaData rsmd = res.getMetaData();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            while (res.next()) {
 | 
					 | 
				
			||||||
                String row = "";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                for (int i = 1; i <= rsmd.getColumnCount(); ++i) {
 | 
					 | 
				
			||||||
                    if (row.length() > 0) {
 | 
					 | 
				
			||||||
                        row += ", ";
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    if (res.getObject(i) != null) {
 | 
					 | 
				
			||||||
                        row +=
 | 
					 | 
				
			||||||
                                rsmd.getColumnName(i) +
 | 
					 | 
				
			||||||
                                        ": " +
 | 
					 | 
				
			||||||
                                        res.getObject(i).toString();
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                Log.Log.debug(row);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        } catch (SQLException e) {
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public static DefaultTableModel logToTable(ResultSet res) {
 | 
					 | 
				
			||||||
        try {
 | 
					 | 
				
			||||||
            ResultSetMetaData rsmd = res.getMetaData();
 | 
					 | 
				
			||||||
            Vector<String> columnNames = new Vector<>();
 | 
					 | 
				
			||||||
            int columnCount = rsmd.getColumnCount();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            for (int i = 1; i <= columnCount; ++i) {
 | 
					 | 
				
			||||||
                columnNames.add(rsmd.getColumnName(i));
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            Vector<Vector<Object>> data = new Vector<>();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            while (res.next()) {
 | 
					 | 
				
			||||||
                Vector<Object> row = new Vector();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                for (int i = 1; i <= columnCount; ++i) {
 | 
					 | 
				
			||||||
                    row.add(res.getObject(i));
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                data.add(row);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            return new DefaultTableModel(data, columnNames);
 | 
					 | 
				
			||||||
        } catch (SQLException e) {
 | 
					 | 
				
			||||||
            e.printStackTrace();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return null;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user