Below is a description on how to use the classes in the below script
include 'zdb.php';
public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { | |
private List<CustomObject> objects; | |
private OnItemSelectedListener listener; | |
private final boolean withContextMenu; | |
class ViewHolder extends RecyclerView.ViewHolder | |
implements View.OnClickListener, View.OnCreateContextMenuListener, PopupMenu.OnMenuItemClickListener { | |
@BindView(R.id.custom_name) |
package me.woemler.sqlbuilder; | |
import org.springframework.util.Assert; | |
import java.util.Arrays; | |
import java.util.List; | |
/** | |
* Based on com.nurkiewicz.jdbcrepository.TableDescription, with a number of modifications. | |
* |
Step 1: Add any functions you want to call into the interface (EventListener).
Step 2: Implement those functions in your MainActivity.
Step 3: Create the listener in your Fragment and attach it to the Activity.
Step 4: Call any functions on the listener.
/** | |
* Convert the ResultSet to a List of Maps, where each Map represents a row with columnNames and columValues | |
* @param rs | |
* @return | |
* @throws SQLException | |
*/ | |
private List<Map<String, Object>> resultSetToList(ResultSet rs) throws SQLException { | |
ResultSetMetaData md = rs.getMetaData(); | |
int columns = md.getColumnCount(); | |
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>(); |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.util.Iterator; | |
import org.apache.poi.hssf.usermodel.HSSFCell; | |
import org.apache.poi.hssf.usermodel.HSSFRow; | |
import org.apache.poi.hssf.usermodel.HSSFSheet; | |
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |