private void setParams(PreparedStatement stm, Object[] params) throws SQLException {
        for (int i = 0; i < params.length; i++) {
            Object o = params[i];

            if (o instanceof String) {
                stm.setString(i + 1, (String) o);
            }

            if (o instanceof Integer) {
                stm.setInt(i + 1, ((Integer) o).intValue());
            }

            if (o instanceof Float) {
                stm.setFloat(i + 1, ((Float) o).floatValue());
            }

            if (o instanceof Date) {
                stm.setDate(i + 1, (Date) o);
            }
            if (o instanceof Long){
                stm.setLong(i + 1, ((Long)o).longValue());
            }
        }
    }