Package com.volantis.mcs.repository.jdbc

Examples of com.volantis.mcs.repository.jdbc.JDBCRepositoryException


            pstmt.executeUpdate();
            pstmt.close();
            pstmt = null;
        } catch (SQLException sqle) {
            logger.error("sql-exception", sqle);
            throw new JDBCRepositoryException(sqle);
        } finally {
            try {
                if (pstmt != null) {
                    pstmt.close();
                }
            } catch (SQLException e) {
                logger.error("sql-exception", e);
                throw new JDBCRepositoryException(e);
            }
        }
    }
View Full Code Here


      return true;
    }
    catch (SQLException sqle) {
      logger.error("sql-exception", sqle);
      throw new JDBCRepositoryException (sqle);
    }
  }
View Full Code Here

    try {
      rs.getStatement ().close ();
    }
    catch (SQLException sqle) {
      logger.error("sql-exception", sqle);
      throw new JDBCRepositoryException (sqle);
    }
  }
View Full Code Here

                //||maxFreeConnections < optimalFreeConnections
                //||optimalFreeConnections < minFreeConnections
                || maxFreeConnections < initialConnections
                || initialConnections < minFreeConnections) {

            throw new JDBCRepositoryException(EXCEPTION_LOCALIZER.format(
                    "jdbc-pool-invalid-configuration", new Integer[]{
                        new Integer(maxConnections),
                        new Integer(maxFreeConnections),
                        new Integer(initialConnections),
                        new Integer(minFreeConnections)
                    }));
        }

        listener = new PooledConnectionListener();

        try {
            for (int c = 0; c < initialConnections; c += 1) {
                PooledConnection pooledConnection = createPooledConnection();
                freeConnections.add(pooledConnection);
            }
        } catch (SQLException sqle) {
            logger.error("sql-exception", sqle);
            throw new JDBCRepositoryException(sqle);
        }

        backgroundThread = new BackgroundThread();
    backgroundThread.setDaemon(true);
        backgroundThread.start();
View Full Code Here

            } else if (cpi instanceof String) {
                try {
                    return Integer.parseInt((String) cpi);
                } catch (NumberFormatException e) {
                    logger.error("unexpected-exception", e);
                    throw new JDBCRepositoryException(EXCEPTION_LOCALIZER.format(
                            "connection-invalid-poll-interval", cpi));
                }
            }
        }
        return 0;
View Full Code Here

    protected static String getUsername(Map properties)
            throws RepositoryException {

        String username = (String) properties.get(USERNAME_PROPERTY);
        if (username == null || username.length() == 0) {
            throw new JDBCRepositoryException(
                    EXCEPTION_LOCALIZER.format("jdbc-missing-user-name"));
        }

        return username;
    }
View Full Code Here

        String vendor = (String) properties.get(VENDOR_PROPERTY);
        // todo - this HYPERSONIC stuff is a bit of a hack - it could be done
        // better. I don't have time to fix it up now.
        if (!VENDOR_HYPERSONIC.equalsIgnoreCase(vendor)) {
            if (password == null || password.length() == 0) {
                throw new JDBCRepositoryException(
                        EXCEPTION_LOCALIZER.format("jdbc-missing-password"));
            }
        }
        return password;
    }
View Full Code Here

    protected static String getHost(Map properties)
            throws RepositoryException {

        String host = (String) properties.get(HOST_PROPERTY);
        if (host == null || host.length() == 0) {
            throw new JDBCRepositoryException(
                    EXCEPTION_LOCALIZER.format("jdbc-missing-host"));
        }

        return host;
    }
View Full Code Here

        if (value instanceof Integer) {
            return ((Integer) value).intValue();
        } else {
            String string = (String) value;
            if (string == null || string.length() == 0) {
                throw new JDBCRepositoryException(
                        EXCEPTION_LOCALIZER.format("jdbc-missing-port"));
            }

            try {
                return Integer.parseInt(string);
            } catch (NumberFormatException nfe) {
                throw new JDBCRepositoryException(EXCEPTION_LOCALIZER.format(
                        "jdbc-invalid-port",
                        string));
            }
        }
    }
View Full Code Here

    protected static String getSource(Map properties)
            throws RepositoryException {

        String source = (String) properties.get(SOURCE_PROPERTY);
        if (source == null || source.length() == 0) {
            throw new JDBCRepositoryException(
                    EXCEPTION_LOCALIZER.format("jdbc-missing-source"));
        }

        return source;
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.repository.jdbc.JDBCRepositoryException

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.