Examples of ResourceException


Examples of javax.resource.ResourceException

    public String getEISProductVersion() throws ResourceException {
        try {
            Connection con = mc.getJdbcConnection();
            return con.getMetaData().getDatabaseProductVersion();
        } catch (SQLException ex) {
            ResourceException re = new EISSystemException(ex.getMessage());
            re.setLinkedException(ex);
            throw re;
        }
    }
View Full Code Here

Examples of javax.resource.ResourceException

    public int getMaxConnections() throws ResourceException {
        try {
            Connection con = mc.getJdbcConnection();
            return con.getMetaData().getMaxConnections();
        } catch (SQLException ex) {
            ResourceException re = new EISSystemException(ex.getMessage());
            re.setLinkedException(ex);
            throw re;
        }
    }
View Full Code Here

Examples of javax.resource.ResourceException

     */
  private void checkProperties() throws ResourceException {
    // LDAP URL
    if(this.config.getLdapUrl() == null) {
            final String msg = LDAPPlugin.Util.getString("LDAPConnection.urlPropNotFound"); //$NON-NLS-1$
            throw new ResourceException(msg);
    }
    // LDAP Admin User DN
    if(this.config.getLdapAdminUserDN() == null) {
            final String msg = LDAPPlugin.Util.getString("LDAPConnection.adminUserDNPropNotFound"); //$NON-NLS-1$
            throw new ResourceException(msg);
    }
    // LDAP Admin User Password
    if(this.config.getLdapAdminUserPassword() == null) {
            final String msg = LDAPPlugin.Util.getString("LDAPConnection.adminUserPassPropNotFound"); //$NON-NLS-1$
            throw new ResourceException(msg);
    }
  }
View Full Code Here

Examples of javax.resource.ResourceException

   
    try {
      initContext = new InitialLdapContext(connenv, null);
    } catch(NamingException ne){
            final String msg = LDAPPlugin.Util.getString("LDAPConnection.directoryNamingError",ne.getExplanation()); //$NON-NLS-1$
      throw new ResourceException(msg);
    }
    LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Successfully obtained initial LDAP context."); //$NON-NLS-1$
    return initContext;
  }
View Full Code Here

Examples of javax.resource.ResourceException

    public javax.resource.cci.LocalTransaction getLocalTransaction()
      throws ResourceException {
  try {
        java.sql.Connection con = getJdbcConnection();
  if (con.getTransactionIsolation() == con.TRANSACTION_NONE) {
      throw new ResourceException("Local Transaction not supported!!");
  }
  } catch(Exception e) {
      throw new ResourceException(e.getMessage());
  }
        return new CciLocalTransactionImpl(mc);
    }
View Full Code Here

Examples of javax.resource.ResourceException

    public void setAutoCommit(boolean autoCommit) throws ResourceException {

  try {
      java.sql.Connection con = getJdbcConnection();
      if (con.getTransactionIsolation() == con.TRANSACTION_NONE) {
          throw new ResourceException("Local Transaction not " +
              "supported!!");
      }
      con.setAutoCommit(autoCommit);
  }catch(Exception e) {
      throw new ResourceException(e.getMessage());
  }
    }
View Full Code Here

Examples of javax.resource.ResourceException

       
  boolean val = false;
  try{
            java.sql.Connection con = getJdbcConnection();
      if (con.getTransactionIsolation() == con.TRANSACTION_NONE) {
          throw new ResourceException("Local Transaction not " +
              "supported!!");
      }
            val =  con.getAutoCommit();
  }catch(SQLException e) {
      throw new ResourceException(e.getMessage());
  }
  return val;
    }
View Full Code Here

Examples of javax.resource.ResourceException

        mc = newMc;
    }

    void checkIfValid() throws ResourceException {
        if (mc == null) {
            throw new ResourceException("Connection is invalid");
        }
    }
View Full Code Here

Examples of javax.resource.ResourceException

 
  String getUserName() throws ResourceException {
      try {
        return sfSoap.getUserInfo(sh).getUserName();
      } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
        throw new ResourceException(e);
      }
  }
View Full Code Here

Examples of javax.resource.ResourceException

      // This value identifies Teiid as a SF certified solution.
      // It was provided by SF and should not be changed.
      co.setClient("RedHat/MetaMatrix/"); //$NON-NLS-1$
     
      if(url == null) {
        throw new ResourceException("SalesForce URL is not specified, please provide a valid URL"); //$NON-NLS-1$
      }

      Bus bus = BusFactory.getThreadDefaultBus();
      BusFactory.setThreadDefaultBus(mcf.getBus());
      try {
        sfService = new SforceService();
        sfSoap = sfService.getSoap();
        ((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url.toExternalForm());
        loginResult = sfSoap.login(username, password);
      } catch (LoginFault e) {
        throw new ResourceException(e);
      } catch (InvalidIdFault e) {
        throw new ResourceException(e);
      } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
        throw new ResourceException(e);
      } finally {
        BusFactory.setThreadDefaultBus(bus);
      }
      LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Login was successful for username " + username); //$NON-NLS-1$

      sh = new SessionHeader();
      sh.setSessionId(loginResult.getSessionId());
      // Reset the SOAP endpoint to the returned server URL
      ((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,loginResult.getServerUrl());
      // or maybe org.apache.cxf.message.Message.ENDPOINT_ADDRESS
      ((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,Boolean.TRUE);
      // Set the timeout.
      //((BindingProvider)sfSoap).getRequestContext().put(JAXWSProperties.CONNECT_TIMEOUT, timeout);

     
      // Test the connection.
      try {
        sfSoap.getUserInfo(sh);
      } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
        throw new ResourceException(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.