Package org.apache.isis.objectstore.sql

Examples of org.apache.isis.objectstore.sql.SqlObjectStoreException


                                // use the value.
                                final String fieldName = Sql.sqlFieldName(identifier.getMemberName());
                                sql.append(fieldName + "=?");
                                connector.addToQueryValues(res);
                            } else {
                                throw new SqlObjectStoreException("Unhandled combination!");
                            }
                        }
                        foundFields++;
                    }
                }
View Full Code Here


            for (final CollectionMapper collectionMapper : collectionMappers) {
                collectionMapper.loadInternalCollection(connector, object);
            }
        } else {
            rs.close();
            throw new SqlObjectStoreException("Unable to load data from " + table + " with id " + object.getOid().enString(getOidMarshaller()));
        }
    }
View Full Code Here

                connection.close();
                connection = null;

            }
        } catch (final SQLException e) {
            throw new SqlObjectStoreException("Failed to close", e);
        }
    }
View Full Code Here

            result.next();
            final int count = result.getInt(1);
            statement.close();
            return count;
        } catch (final SQLException e) {
            throw new SqlObjectStoreException("Failed count", e);
        }
    }
View Full Code Here

            final String url = params.getString(BASE + "connection");
            final String user = params.getString(BASE + "user");
            final String password = params.getString(BASE + "password");

            if (connection != null) {
                throw new SqlObjectStoreException("Connection already established");
            }

            if (driver == null) {
                throw new SqlObjectStoreException("No driver specified for database connection");
            }
            if (url == null) {
                throw new SqlObjectStoreException("No connection URL specified to database");
            }
            if (user == null) {
                LOG.info("No user specified; will attempt to login with no credentials");
            } else {
                if (password == null) {
                    throw new SqlObjectStoreException("No password specified for database connection");
                }
            }

            Class.forName(driver);
            connection = getConnection(url, user, password);
            if (connection == null) {
                throw new SqlObjectStoreException("No connection established to " + url);
            }
        } catch (final SQLException e) {
            throw new SqlObjectStoreException("Failed to start", e);
        } catch (final ClassNotFoundException e) {
            throw new SqlObjectStoreException("Could not find database driver", e);
        }

    }
View Full Code Here

        try {
            statement = connection.prepareStatement(sql);
            addPreparedValues(statement);
            return new JdbcResults(statement.executeQuery());
        } catch (final SQLException e) {
            throw new SqlObjectStoreException(e);
        } finally {
            clearPreparedValues();
        }
    }
View Full Code Here

            final int updateCount = statement.executeUpdate();
            statement.close();
            return updateCount;
        } catch (final SQLException e) {
            LOG.error("failed to execute " + sql, e);
            throw new SqlObjectStoreException("SQL error: " + e.toString(), e);
        } finally {
            clearPreparedValues();
        }
    }
View Full Code Here

            } else {
                set.close();
                return false;
            }
        } catch (final SQLException e) {
            throw new SqlObjectStoreException(e);
        }
    }
View Full Code Here

            } else {
                set.close();
                return false;
            }
        } catch (final SQLException e) {
            throw new SqlObjectStoreException(e);
        }
    }
View Full Code Here

            statement.executeUpdate();
            /*
             * require 3.0 ResultSet rs = statement.getGeneratedKeys(); if(rs.next()) { int id = rs.getInt(1); }
             */statement.close();
        } catch (final SQLException e) {
            throw new SqlObjectStoreException("SQL error", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.objectstore.sql.SqlObjectStoreException

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.