Examples of PMException


Examples of org.apache.ws.jaxme.PMException

            delim = c;
            sb.append(c);
            break;
          case '?':
            if (!iter.hasNext()) {
              throw new PMException("Number of placeholder marks exceeds number of actual parameters");
            }
            PMParams.Param param = (PMParams.Param) iter.next();
            switch (param.getType()) {
              case Types.VARCHAR:
                sb.append('\'');
                sb.append(param.getValue());
                sb.append('\'');
                break;
              case Types.BIGINT:
              case Types.INTEGER:
              case Types.SMALLINT:
              case Types.TINYINT:
                sb.append(param.getValue());
                break;
              case Types.TIMESTAMP:
                sb.append('\'');
                sb.append(DatatypeConverter.printDateTime((Calendar) param.getValue()));
                sb.append('\'');
                break;
              case Types.DATE:
                sb.append('\'');
                sb.append(DatatypeConverter.printDate((Calendar) param.getValue()));
                sb.append('\'');
                break;
              case Types.TIME:
                sb.append('\'');
                sb.append(DatatypeConverter.printTime((Calendar) param.getValue()));
                sb.append('\'');
                break;
              default:
                throw new PMException("Invalid parameter type: " + param.getType());
            }
            break;
          default:
            sb.append(c);
            break;
        }
      }
    }
    if (inStr) {
      throw new PMException("Failed to parse query, expected trailing " + delim + " character: " + pQuery);
    }
    if (iter.hasNext()) {
      throw new PMException("Number of actual parameters exceeds number of placeholder marks.");
    }
    return sb.toString();
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

          r.getContentAsSAX(handler);
        }
      }
    }
  } catch (XMLDBException e) {
    throw new PMException(e);
  } catch (IllegalAccessException e) {
    throw new PMException(e);
  } catch (InstantiationException e) {
    throw new PMException(e);
  }
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

      ContentHandler ch = resource.setContentAsSAX();
      Marshaller marshaller = getManager().getFactory().createMarshaller();
      marshaller.marshal(pElement, ch);
      col.storeResource(resource);
    } catch (XMLDBException e) {
      throw new PMException(e);
    } catch (IllegalAccessException e) {
      throw new PMException(e);
    } catch (InstantiationException e) {
      throw new PMException(e);
    } catch (NoSuchMethodException e) {
      throw new PMException(e);
    } catch (InvocationTargetException e) {
      throw new PMException(e.getTargetException());
    } catch (JAXBException e) {
      if (e instanceof PMException) {
        throw (PMException) e;
      } else {
        throw new PMException(e);
      }
    }
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

      ContentHandler ch = resource.setContentAsSAX();
      Marshaller marshaller = getManager().getFactory().createMarshaller();
      marshaller.marshal(pElement, ch);
      col.storeResource(resource);
    } catch (XMLDBException e) {
      throw new PMException(e);
    } catch (IllegalAccessException e) {
      throw new PMException(e);
    } catch (InstantiationException e) {
      throw new PMException(e);
    } catch (NoSuchMethodException e) {
      throw new PMException(e);
    } catch (InvocationTargetException e) {
      throw new PMException(e.getTargetException());
    } catch (JAXBException e) {
      if (e instanceof PMException) {
        throw (PMException) e;
      } else {
        throw new PMException(e);
      }
    }
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

     Collection col = getXmlDbCollection();
     String id = getId(pElement);
     XMLResource resource = (XMLResource) col.createResource(id, XMLResource.RESOURCE_TYPE);
     col.removeResource(resource);
   } catch (XMLDBException e) {
     throw new PMException(e);
   } catch (IllegalAccessException e) {
     throw new PMException(e);
   } catch (InstantiationException e) {
     throw new PMException(e);
   } catch (InvocationTargetException e) {
     throw new PMException(e.getTargetException());
   } catch (NoSuchMethodException e) {
     throw new PMException(e);
    } catch (JAXBException e) {
      if (e instanceof PMException) {
        throw (PMException) e;
      } else {
        throw new PMException(e);
      }
   }
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

    InoResponseHandler irh = new InoResponseHandler();
  try {
    q += encoder.encode(pQuery);
  } catch (UnsupportedEncodingException e) {
    throw new PMException(e);
  }
  JMUnmarshallerHandler handler = (JMUnmarshallerHandler) getManager().getFactory().createUnmarshaller().getUnmarshallerHandler();
  handler.setObserver(pObserver);
  irh.setResultHandler(handler);
  try {
    performQuery(q, irh);
  } catch (SAXException e) {
    throw new PMException(e);
  }
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

        handler.init((JMUnmarshaller) null);
        handler.setObserver(pObserver);
        irh.setResultHandler(handler);
        performQuery(q, irh);
    } catch (InstantiationException e) {
      throw new PMException(e);
    } catch (IllegalAccessException e) {
      throw new PMException(e);
    } catch (SAXException e) {
      throw new PMException(e);
    } catch (JAXBException e) {
      if (e instanceof PMException) {
        throw (PMException) e;
      } else {
        throw new PMException(e);
      }
    } catch (UnsupportedEncodingException e) {
        throw new PMException(e);
    }
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

    try {
      String query = getInsertQuery(pElement);
      java.util.List idList = new java.util.ArrayList();
      performQuery(query, idList);
      if (idList.size() == 0) {
        throw new PMException("Query did not return an ino:id");
      }
    } catch (SAXException e) {
      throw new PMException(e);
    } catch (JAXBException e) {
      if (e instanceof PMException) {
        throw (PMException) e;
      } else {
        throw new PMException(e);
      }
    } catch (UnsupportedEncodingException e) {
        throw new PMException(e);
    }
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

  public void update(javax.xml.bind.Element pElement) throws PMException {
      try {
          String query = getUpdateQuery(pElement);
          performQuery(query, (java.util.List) null);
      } catch (SAXException e) {
          throw new PMException(e);
      } catch (UnsupportedEncodingException e) {
          throw new PMException(e);
      } catch (JAXBException e) {
          if (e instanceof PMException) {
              throw (PMException) e;
          } else {
              throw new PMException(e);
          }
      }
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

  public void delete(javax.xml.bind.Element pElement) throws PMException {
    try {
      String query = getDeleteQuery(pElement);
      performQuery(query, (java.util.List) null);
    } catch (NoSuchMethodException e) {
      throw new PMException(e);
    } catch (IllegalAccessException e) {
      throw new PMException(e);
    } catch (InvocationTargetException e) {
      throw new PMException(e.getTargetException());
    } catch (SAXException e) {
      throw new PMException(e);
    } catch (JAXBException e) {
      if (e instanceof PMException) {
        throw (PMException) e;
      } else {
        throw new PMException(e);
      }
    } catch (UnsupportedEncodingException e) {
        throw new PMException(e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.