mysql.setCatalog(db); ResultSet rs = mysql.createStatement().executeQuery(sql);
sqlrun.setCatalog(db);  ResultSet rs = sqlrun.executeQuery(sql);
	public void addDataToTable(String sql, String db, DataSourceConfig database) {		if (!init)			initTable();		while (true) {			TreeIter item = ls.getIter("0");			if (item == null)				break;			ls.removeRow(item);		}		try {			long start = System.currentTimeMillis();			Class.forName(database.getDriver());			Connection mysql = DriverManager.getConnection(database.getUrl(), database.getUserid(), database.getPassword());			System.out.println("Getting columns for table: " + tablename);			if (sql == null)				sql = "select * from " + tablename;			mysql.setCatalog(db);			ResultSet rs = mysql.createStatement().executeQuery(sql);			addColumnsFromResultSet(rs);			int counter = 0;			while (rs.next()) {				counter++;				TreeIter dbrow = ls.appendRow();				for (int i = 0; i < columnnames.size(); i++) {					String columnvalue = rs.getString(columnnames.get(i).toString());					ls.setValue(dbrow, (DataColumnString) columns[i], columnvalue);				}				if (counter >= JDBMain.getMaxRows())					break;			}			long end = System.currentTimeMillis();			JDBMain.setStatusbarMessage("Got "+counter+" rows in "+(end-start)+" milliseconds");			rs.close();			mysql.close();			list.showAll();		} catch (ClassNotFoundException e) {			JDBMain.showErrorDialog(e.getMessage());			e.printStackTrace();		} catch (SQLException e) {			JDBMain.showErrorDialog(e.getMessage());			e.printStackTrace();		}	}