Package org.apache.isis.runtimes.dflt.objectstores.sql

Examples of org.apache.isis.runtimes.dflt.objectstores.sql.SqlObjectStoreException


            // date is UTC.
            final String string = set.getString(columnName);
            final DateTime utcDate = new DateTime(string, Defaults.getTimeZone());
            return new Date(utcDate);
        } catch (final SQLException e) {
            throw new SqlObjectStoreException(e);
        }
    }
View Full Code Here


            final DateTimeFormatter formatter = DateTimeFormat.forPattern("HH:mm:ss");
            final DateTimeZone defaultTimeZone = Defaults.getTimeZone();
            final DateTime utcDate = formatter.withZone(defaultTimeZone).parseDateTime(string);
            return new Time(utcDate);
        } catch (final SQLException e) {
            throw new SqlObjectStoreException(e);
        }
    }
View Full Code Here

    @Override
    public double getDouble(final String columnName) {
        try {
            return set.getDouble(columnName);
        } catch (final SQLException e) {
            throw new SqlObjectStoreException(e);
        }
    }
View Full Code Here

        try {
            final HashMap<String, Class<?>> map = new HashMap<String, Class<?>>();
            map.put("FLOAT", float.class);
            return set.getObject(columnName, map);
        } catch (final SQLException e) {
            throw new SqlObjectStoreException(e);
        }
    }
View Full Code Here

    @Override
    public Float getFloat(final String columnName) {
        try {
            return set.getFloat(columnName);
        } catch (final SQLException e) {
            throw new SqlObjectStoreException(e);
        }
    }
View Full Code Here

    @Override
    public Short getShort(final String columnName) {
        try {
            return set.getShort(columnName);
        } catch (final SQLException e) {
            throw new SqlObjectStoreException(e);
        }
    }
View Full Code Here

    @Override
    public Boolean getBoolean(final String columnName) {
        try {
            return set.getBoolean(columnName);
        } catch (final SQLException e) {
            throw new SqlObjectStoreException(e);
        }
    }
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) {
                throw new SqlObjectStoreException("No user specified for database connection");
            }
            if (password == null) {
                throw new SqlObjectStoreException("No password specified for database connection");
            }

            Class.forName(driver);
            LOG.info("Connecting to " + url + " as " + user);
            connection = DriverManager.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

TOP

Related Classes of org.apache.isis.runtimes.dflt.objectstores.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.