Package ch.inftec.ju.db

Examples of ch.inftec.ju.db.JuDbException


        public void execute(IDatabaseConnection conn) {
          try {
            logger.debug("Executing Insert from: " + dataSetUrl);
            DatabaseOperation.INSERT.execute(conn, getDataSet(conn));
          } catch (Exception ex) {
            throw new JuDbException("Couldnt insert data into DB", ex);
          }
        };
      });
     
    }
View Full Code Here


        public void execute(IDatabaseConnection conn) {
          try {
            logger.debug("Executing Update from: " + dataSetUrl);
            DatabaseOperation.UPDATE.execute(conn, getDataSet(conn));
          } catch (Exception ex) {
            throw new JuDbException("Couldnt update data in DB", ex);
          }
        };
      });
     
    }
View Full Code Here

      try {
        this.dataSetUrl = xmlUrl;
        flatXmlDataSet = new FlatXmlDataSetBuilder().build(xmlUrl);
        return this;
      } catch (Exception ex) {
        throw new JuDbException("Couldn't import data from XML: xmlUrl", ex);
      }
    }
View Full Code Here

              .addTablesByDataSet(dataSetUrl, true)
              .createDataSet(conn);
           
            Assertion.assertEquals(flatXmlDataSet, dbDataSet);
          } catch (Exception ex) {
            throw new JuDbException("Couldn't assert DB data", ex);
          }
        }
       
      });
    }
View Full Code Here

        public void execute(IDatabaseConnection conn) {
          try {
            IDataSet  dbDataSet = conn.createDataSet();
            Assertion.assertEquals(flatXmlDataSet, dbDataSet);
          } catch (Exception ex) {
            throw new JuDbException("Couldn't assert DB data", ex);
          }
        }
      });
    }
View Full Code Here

            QueryDataSet tableDataSet = new QueryDataSet(conn);
            tableDataSet.addTable(tableName, String.format("select * from %s order by %s", tableName, orderColumnName));
           
            Assertion.assertEquals(flatXmlDataSet, tableDataSet);
          } catch (Exception ex) {
            throw new JuDbException("Couldn't assert DB data", ex);
          }
        }
      });
    }
View Full Code Here

    public ExportBuilder setTableNamesCasingByDataSet(String resourcePath) {
      try {
        this.exportItems.setCasedTableNames(new XPathGetter(XmlUtils.loadXml(
            JuUrl.resource().relativeTo(DbDataUtil.class).get(resourcePath))).getNodeNames("dataset/*"));
      } catch (Exception ex) {
        throw new JuDbException("Couldn't load table names data set " + resourcePath, ex);
      }
      return this;
    }
View Full Code Here

          }
        }
       
        return this;
      } catch (Exception ex) {
        throw new JuDbException("Couldn't add tables by dataset " + resourceUrl, ex);
      }
    }
View Full Code Here

          try {
            XmlOutputConverter xmlConv = new XmlOutputConverter();
            ExportBuilder.writeToXml(dataSet, xmlConv.getOutputStream());
            doc.setValue(xmlConv.getDocument());
          } catch (Exception ex) {
            throw new JuDbException("Couldn't write DB data to XML document", ex);
          }
        }
      });
     
      return doc.getValue();
View Full Code Here

           @Override
          public void execute(IDataSet dataSet) {
            try {
              ExportBuilder.writeToXml(dataSet, stream);
            } catch (Exception ex) {
              throw new JuDbException("Couldn't write DB data to byte stream", ex);
            }
          }
        });
      } catch (Exception ex) {
        throw new JuDbException("Couldn't write DB data to byte stream", ex);
      }
     
      try {
        return bos.toString("utf-8");
      } catch (Exception ex) {
View Full Code Here

TOP

Related Classes of ch.inftec.ju.db.JuDbException

Copyright © 2018 www.massapicom. 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.