Examples of JDBCRepositoryException


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

                    stmt.close();
                }
            }
            catch (SQLException e) {
                logger.error("sql-exception", e);
                throw new JDBCRepositoryException(e);
            }
            throw new JDBCRepositoryException(sqle);
        }
        if (descriptor != null) {
            final String languageField =
                resolveFieldName(jdbcConnection, LANGUAGE_COLUMN_NAMES);
            // find the best mathing descriptor
            stmt = null;
            try {
                stmt = sqlConnection.createStatement();
                final String sql =
                    "select " + categoryNameField + " , " + languageField +
                    " from " + vmPolicyCategoryTable + " where " +
                    categoryIDField + " = " + categoryId + " and " +
                    projectField + " = " +
                    JDBCAccessorHelper.quoteValue(getProjectName());

                if (logger.isDebugEnabled()){
                    logger.debug(sql);
                }

                final ResultSet rs = stmt.executeQuery(sql);
                final String[] values = getBestMatchingValues(jdbcConnection,
                    rs, new String[]{categoryNameField}, locale);
                descriptor.setCategoryDescriptiveName(values[0]);
                descriptor.setLanguage(values[1]);
            }
            catch (SQLException sqle) {
                logger.error("sql-exception", sqle);
                try {
                    if (stmt != null) {
                        stmt.close();
                    }
                }
                catch (SQLException e) {
                    logger.error("sql-exception", e);
                    throw new JDBCRepositoryException(e);
                }
                throw new JDBCRepositoryException(sqle);
            }
        }
        return descriptor;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.