Examples of JDBCStore


Examples of hermes.config.JDBCStore

   }
   public MessageStoreURLTreeNode(String alias, String jdbcURL)
   {
      super(alias, jdbcURL);
     
      storeConfig = new JDBCStore() ;
      storeConfig.setAlias(alias) ;
      storeConfig.setUrl(jdbcURL) ;
     
      setIcon(IconCache.getIcon("jdbc")) ;
     
View Full Code Here

Examples of hermes.config.JDBCStore

   protected void doOnOK(Map<String, String> properties)
   {
      try
      {
         final JDBCStore storeConfig = HermesBrowser.getConfigDAO().addJDBCStore(HermesBrowser.getBrowser().getConfig(), properties.get("alias"), properties.get("driver"),
               properties.get("url"));
         final MessageStoreURLTreeNode node = new MessageStoreURLTreeNode(storeConfig);

         HermesBrowser.getBrowser().getBrowserTree().getBrowserModel().addMessageStoreURLTreeNode(node);
         HermesBrowser.getBrowser().saveConfig();
View Full Code Here

Examples of hermes.config.JDBCStore

   {
      final Map<String, String> properties = new HashMap<String, String>();

      if (e.getSource() != null && e.getSource() instanceof JDBCStore)
      {
         JDBCStore config = (JDBCStore) e.getSource();

         properties.put("alias", config.getAlias());
         properties.put("url", config.getUrl());
         properties.put("driver", config.getDriver());
      }
      else
      {
         properties.put("alias", "myJDBC");
         properties.put("url", "jdbc:provider://<hostname>[<:port>]/<dbname>[?<param1>=<value1>]");
View Full Code Here

Examples of hermes.config.JDBCStore

    * @see hermes.impl.ConfigDAO#addJDBCStore(hermes.config.HermesConfig,
    *      java.lang.String, java.lang.String, java.lang.String)
    */
   public JDBCStore addJDBCStore(HermesConfig config, String alias, String driver, String url) throws JAXBException
   {
      JDBCStore storeConfig = factory.createJDBCStore();
      storeConfig.setAlias(alias);
      storeConfig.setDriver(driver);
      storeConfig.setUrl(url);

      for (Iterator iter = config.getJdbcStore().iterator(); iter.hasNext();)
      {
         JDBCStore existing = (JDBCStore) iter.next();

         if (existing.getAlias().equals(alias))
         {
            iter.remove();
         }
      }

View Full Code Here

Examples of hermes.config.JDBCStore

         addMessageStoreURLTreeNode(localURLNode);
      }

      for (Iterator iter = HermesBrowser.getBrowser().getConfig().getJdbcStore().iterator(); iter.hasNext();)
      {
         JDBCStore storeConfig = (JDBCStore) iter.next();

         try
         {
            addMessageStoreURLTreeNode(new MessageStoreURLTreeNode(storeConfig));
         }
         catch (ClassNotFoundException ex)
         {
            HermesBrowser.getBrowser().showErrorDialog("Cannot load JDBC driver " + storeConfig.getDriver());
         }

      }

      Hermes.events.addConnectionListener(this);
View Full Code Here

Examples of org.apache.openjpa.jdbc.kernel.JDBCStore

        if (edata == null || !(edata instanceof ConnectionInfo))
            return null;

        Result result = ((ConnectionInfo) edata).result;
        if (result instanceof ResultSetResult) {
            JDBCStore store = ((ResultSetResult) result).getStore();
            for (SliceStoreManager slice : _slices) {
                if (slice == store) {
                    return slice.getName();
                }
            }
View Full Code Here

Examples of org.apache.openjpa.jdbc.kernel.JDBCStore

        throws Exception {
       
        EntityManager em = currentEntityManager();
        Broker broker = JPAFacadeHelper.toBroker(em);
      
        JDBCStore store = (JDBCStore)broker.getStoreManager();

        Connection conn = store.getConnection();
        Statement stmnt = conn.createStatement();
        ResultSet rs = stmnt.executeQuery("SELECT * FROM RAWSQL "
        + "ORDER BY INTFIELD");
        ResultSetResult res = new ResultSetResult(rs,
        store.getConfiguration().getDBDictionaryInstance());
        ResultObjectProvider rop = new GenericResultObjectProvider
        (RawSQL.class, store, null, res);
        ResultList rl = new EagerResultList(rop);
        check(rl, broker);
        rl.close();
View Full Code Here

Examples of org.apache.openjpa.jdbc.kernel.JDBCStore

        EntityManager em =emf.createEntityManager();
        startTx(em);
        RuntimeTest1 a = new RuntimeTest1("a-name", 10);
        em.persist(a);
        em.flush();
        JDBCStore store = (JDBCStore) getStoreManager(em, true);
        Connection conn = store.getConnection();
        ClassMapping mapping = store.getConfiguration().
                getMappingRepositoryInstance().getMapping(RuntimeTest1.class,
                null, true);
        FieldMapping fm = mapping.getFieldMapping("stringField");
        String tableName =
            store.getConfiguration().getDBDictionaryInstance().getFullName(
                    fm.getTable(), false);
        String colName = fm.getColumns()[0].getName();
        Statement st = conn.createStatement();
        ResultSet rs = st.executeQuery("SELECT " + colName + " FROM "
                + tableName + " WHERE " + colName + " = 'a-name'");
View Full Code Here

Examples of org.apache.openjpa.jdbc.kernel.JDBCStore

        if (edata == null || !(edata instanceof ConnectionInfo))
            return null;

        Result result = ((ConnectionInfo) edata).result;
        if (result instanceof ResultSetResult) {
            JDBCStore store = ((ResultSetResult) result).getStore();
            for (SliceStoreManager slice : _slices) {
                if (slice == store) {
                    return slice.getName();
                }
            }
View Full Code Here

Examples of org.apache.openjpa.jdbc.kernel.JDBCStore

        if (edata == null || !(edata instanceof ConnectionInfo))
            return null;

        Result result = ((ConnectionInfo) edata).result;
        if (result instanceof ResultSetResult) {
            JDBCStore store = ((ResultSetResult) result).getStore();
            for (SliceStoreManager slice : _slices) {
                if (slice == store) {
                    String sliceId = slice.getName();
                    sm.setImplData(sliceId, true);
                    return sliceId;
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.