	private boolean insertIntoTable(String className, Product product) {
		try {
			int originalCount = getRecordCount(className);
			Class<?> c = product.getClass();
			Field[] fields = c.getFields();
			fields = sortFields(fields);
			String sql = "INSERT INTO " + className + "(";
			for (int i = 0; i < fields.length; i++) {
				sql += fields[i].getName();
				if (i < fields.length-1) {
					sql += ",";
				}
			}
			sql += ") values (";
			for (int i = 0; i < fields.length; i++) {
				sql += "?";
				if (i < fields.length-1) {
					sql += ",";
				}
			}
			sql += ");";
			PreparedStatement preparedStatement = conn.prepareStatement(sql);
			preparedStatement.setInt(1, 1);
			for (int i = 0; i < fields.length; i++) {	
				Object obj = fields[i].get(product);
				String data = "";
				if (obj != null) {
					data = fields[i].get(product).toString();
				}
				setPreparedStatementValues(preparedStatement, fields[i], i+1, product);	
			}
			preparedStatement.addBatch();
			preparedStatement.executeBatch();
			if (getRecordCount(className) == originalCount+1) {
				return true;
			} else {
				return false;
			}
		} catch (Exception e) {
			System.err.println("Error on database insert");
			e.printStackTrace();
			return false;
		}
	}

	private boolean insertIntoTable(String className, Product product) {
		try {
			int originalCount = getRecordCount(className);
			Class<?> c = product.getClass();
			Field[] fields = c.getFields();
			fields = sortFields(fields);
			String sql = "INSERT INTO " + className + "(";
			for (int i = 0; i < fields.length; i++) {
				sql += fields[i].getName();
				if (i < fields.length-1) {
					sql += ",";
				}
			}
			sql += ") values (";
			for (int i = 0; i < fields.length; i++) {
				sql += "?";
				if (i < fields.length-1) {
					sql += ",";
				}
			}
			sql += ");";
			PreparedStatement preparedStatement = conn.prepareStatement(sql);
			preparedStatement.setInt(1, 1);
			for (int i = 0; i < fields.length; i++) {	
				Object obj = fields[i].get(product);
				String data = "";
				if (obj != null) {
					data = fields[i].get(product).toString();
					setPreparedStatementValues(preparedStatement, fields[i], i+1, product);	
				}
			}
			preparedStatement.addBatch();
			preparedStatement.executeBatch();
			if (getRecordCount(className) == originalCount+1) {
				return true;
			} else {
				return false;
			}
		} catch (Exception e) {
			System.err.println("Error on database insert");
			e.printStackTrace();
			return false;
		}
	}
