code: public static void setProperty(Object object, String name, String value)
              throws SQLException {
          Class<?> type = object.getClass();
  
          PropertyDescriptor[] descriptors;
          try {
              descriptors = Introspector.getBeanInfo(type)
                      .getPropertyDescriptors();
          } catch (Exception ex) {
              throw new SQLException(ex);
          }
          List<String> names = new ArrayList<>();
  
          for (PropertyDescriptor descriptor : descriptors) {
              if (descriptor.getWriteMethod() == null) {
                  continue;
              }
  
              if (descriptor.getName().equals(name)) {
                  Method method = descriptor.getWriteMethod();
                  Class<?> paramType = method.getParameterTypes()[0];
                  Object param = toBasicType(value, paramType.getName());
  
                  try {
                      method.invoke(object, param);
                  } catch (Exception ex) {
                      throw new SQLException(ex);
                  }
                  return;
              }
  
              names.add(descriptor.getName());
          }
          throw new SQLException("No such property: " + name +
                  ", exists.  Writable properties are: " + names);
      }
docs: Tries to set the property 'name' to `value` in the given object. This assignation is made using a
  <em>setter</em> method discovered and invoked using reflection.
  @param object the object
  @param name the property name
  @param value the value
  @throws SQLException if the property cannot be set. This happens if there are no setter for the given property
  in the object or if the value cannot be wrapped to the type of the setter parameter.