Package com.ibatis.sqlmap.client

Examples of com.ibatis.sqlmap.client.SqlMapException


        if (keyPropName != null && parameterClass != null) {
          resultClass = PROBE.getPropertyTypeForSetter(parameterClass, selectKeyStatement.getKeyProperty());
        }
      }
    } catch (ClassNotFoundException e) {
      throw new SqlMapException("Error.  Could not set result class.  Cause: " + e, e);
    }

    if (resultClass == null) {
      resultClass = Object.class;
    }
View Full Code Here


      SqlMapSessionImpl sqlMapSession = new SqlMapSessionImpl(this);
      sqlMapSession.open();
      sqlMapSession.setUserConnection(conn);
      return sqlMapSession;
    } catch (SQLException e) {
      throw new SqlMapException("Error setting user provided connection.  Cause: " + e, e);
    }
  }
View Full Code Here

    if (resource != null) {
      reader = Resources.getResourceAsReader(resource);
    } else if (url != null) {
      reader = Resources.getUrlAsReader(url);
    } else {
      throw new SqlMapException("The sqlMap element requires either a resource or a url attribute.");
    }
    new XmlSqlMapParser(this, reader).parse();
  }
View Full Code Here

  public SqlMapSessionImpl(Ibatis2Configuration configuration, Connection conn) {
    this(configuration);
    try {
      setUserConnection(conn);
    } catch (SQLException e) {
      throw new SqlMapException("Could not create SqlMapSession because the provided user " +
          "connection could not be set. Cause: " + e, e);
    }
  }
View Full Code Here

      this.iterator = ((Iterator) collection);
    } else if (collection.getClass().isArray()) {
      List list = arrayToList(collection);
      this.iterator = list.iterator();
    } else {
      throw new SqlMapException("ParameterObject or property was not a Collection, Array or Iterator.");
    }
  }
View Full Code Here

  private static Date format(String format, String datetime) {
    try {
      return new SimpleDateFormat(format).parse(datetime);
    } catch (ParseException e) {
      throw new SqlMapException("Error parsing default null value date.  Format must be '" + format + "'. Cause: " + e);
    }
  }
View Full Code Here

    Transaction transaction = localTransaction.get();
    if (transaction != null) {
      try {
        return transaction;
      } catch (TransactionException e) {
        throw new SqlMapException("Could not get transaction.  Cause: " + e, e);
      }
    }
    throw new SQLException("Could not get current transaction, because there was no transaction started.");
  }
View Full Code Here

        Context ctx = (Context) initCtx.lookup((String) properties.get("DBInitialContext"));
        dataSource = (DataSource) ctx.lookup((String) properties.get("DBLookup"));
      }

    } catch (NamingException e) {
      throw new SqlMapException("There was an error configuring JndiDataSourceTransactionPool. Cause: " + e, e);
    }
  }
View Full Code Here

    if ("Aye".equalsIgnoreCase(s)) {
      return new Boolean(true);
    } else if ("Nay".equalsIgnoreCase(s)) {
      return new Boolean(false);
    } else {
      throw new SqlMapException("Unexpected value " + s + " found where 'Aye' or 'Nay' was expected.");
    }
  }
View Full Code Here

    if ("100".equalsIgnoreCase(s)) {
      return new Boolean(true);
    } else if ("200".equalsIgnoreCase(s)) {
      return new Boolean(false);
    } else {
      throw new SqlMapException("Unexpected value " + s + " found where 100 or 200 was expected.");
    }
  }
View Full Code Here

TOP

Related Classes of com.ibatis.sqlmap.client.SqlMapException

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.