Package org.apache.torque

Examples of org.apache.torque.TorqueException


            selectCriteria.put(pk.getFullyQualifiedName(),
                updateValues.remove(pk.getFullyQualifiedName()));
        }
        else
        {
            throw new TorqueException("No PK specified for database update");
        }

        doUpdate(selectCriteria, updateValues, con);
    }
View Full Code Here


            statement = con.createStatement();
            rowCount = statement.executeUpdate(stmt);
        }
        catch (SQLException e)
        {
            throw new TorqueException(e);
        }
        finally
        {
            if (statement != null)
            {
                try
                {
                    statement.close();
                }
                catch (SQLException e)
                {
                    throw new TorqueException(e);
                }
            }
        }
        return rowCount;
    }
View Full Code Here

     * @exception TorqueException Couldn't handle multiple records.
     */
    protected static void handleMultipleRecords(DataSet ds)
        throws TorqueException
    {
        throw new TorqueException("Criteria expected single Record and "
                + "Multiple Records were selected");
    }
View Full Code Here

                {
                    stmt.close();
                }
                catch (SQLException e)
                {
                    throw new TorqueException(e);
                }
            }
        }
        return v;
    }
View Full Code Here

    private static void throwMalformedColumnNameException(
        String criteriaPhrase,
        String columnName)
        throws TorqueException
    {
        throw new TorqueException("Malformed column name in Criteria "
                + criteriaPhrase
                + ": '"
                + columnName
                + "' is not of the form 'table.column'");
    }
View Full Code Here

                }
            }
            catch (Exception e)
            {
                log.error(e);
                throw new TorqueException(e);
            }
        }
    }
View Full Code Here

                results[0] = new BigDecimal(rs.getString(1)); // next_id
                results[1] = new BigDecimal(rs.getString(2)); // quantity
            }
            else
            {
                throw new TorqueException("The table " + tableName
                        + " does not have a proper entry in the " + ID_TABLE);
            }
        }
        finally
        {
View Full Code Here

                ds = ((DataSource) ctx.lookup(path));
          lastLookup = time;
            }
            catch (Exception e)
            {
                throw new TorqueException(e);
            }
      }

     return ds;
    }
View Full Code Here

     */
    public void initialize(Configuration configuration) throws TorqueException
    {
        if (configuration == null)
        {
            throw new TorqueException(
                "Torque cannot be initialized without "
                    + "a valid configuration. Please check the log files "
                    + "for further details.");
        }
        initJNDI(configuration);
View Full Code Here

        log.debug("Starting initJNDI");
        Hashtable env = null;
        Configuration c = configuration.subset("jndi");
        if (c == null)
        {
            throw new TorqueException(
                "JndiDataSourceFactory requires a jndi "
                    + "path property to lookup the DataSource in JNDI.");
        }
        try
        {
            Iterator i = c.getKeys();
            while (i.hasNext())
            {
                String key = (String) i.next();
                if (key.equals("path"))
                {
                    path = c.getString(key);
                    log.debug("JNDI path: " + path);
                }
                else if (key.equals("ttl"))
    {
        ttl = c.getLong(key, ttl);
                    log.debug("Time between context lookups: " + ttl);
    }
                else
                {
                    if (env == null)
                    {
                        env = new Hashtable();
                    }
                    String value = c.getString(key);
                    env.put(key, value);
                    log.debug("Set jndi property: " + key + "=" + value);
                }
            }
            if (env == null)
            {
                ctx = new InitialContext();
            }
            else
            {
                ctx = new InitialContext(env);
            }
            log.debug("Created new InitialContext");
            debugCtx(ctx);
        }
        catch (Exception e)
        {
            log.error("", e);
            throw new TorqueException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.torque.TorqueException

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.