Пример #1
0
 /**
  * Set the value of the given variable for this session.
  *
  * @param name the name of the variable (may not be null)
  * @param value the new value (may not be null)
  */
 public void setVariable(String name, Value value) {
   initVariables();
   modificationId++;
   Value old;
   if (value == ValueNull.INSTANCE) {
     old = variables.remove(name);
   } else {
     old = variables.put(name, value);
   }
   if (old != null) {
     // close the old value (in case it is a lob)
     old.close();
   }
 }
Пример #2
0
 /**
  * Get the value of the specified user defined variable. This method always returns a value; it
  * returns ValueNull.INSTANCE if the variable doesn't exist.
  *
  * @param name the variable name
  * @return the value, or NULL
  */
 public Value getVariable(String name) {
   initVariables();
   Value v = variables.get(name);
   return v == null ? ValueNull.INSTANCE : v;
 }