Package com.volantis.mcs.repository.jdbc

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


            throws JDBCRepositoryException, RepositoryException {

        // Get the vendor string.
        JDBCDriverVendor vendor = configuration.getDriverVendor();
        if (vendor == null) {
            throw new JDBCRepositoryException(
                    EXCEPTION_LOCALIZER.format("jdbc-missing-vendor"));
        }

        VendorFactory factory = (VendorFactory) VENDOR_2_FACTORY.get(vendor);
        if (factory == null) {
            throw new JDBCRepositoryException(EXCEPTION_LOCALIZER.format(
                    "jdbc-unknown-vendor", vendor));
        }

        DataSource dataSource = factory.createDriverDataSource(configuration);
View Full Code Here


            vendor = getVendorFromDatabase(dataSource);
        }

        VendorFactory factory = (VendorFactory) VENDOR_2_FACTORY.get(vendor);
        if (factory == null) {
            throw new JDBCRepositoryException(EXCEPTION_LOCALIZER.format(
                    "jdbc-unknown-vendor", vendor));
        }

        InternalJDBCRepository repository =
                factory.createRepository(
View Full Code Here

                con = dataSource.getConnection();
                DatabaseMetaData metaData = con.getMetaData();
                databaseProduct = metaData.getDatabaseProductName();
                con.close();
            } catch (SQLException sqle) {
                throw new JDBCRepositoryException(EXCEPTION_LOCALIZER.format(
                        "sql-exception"), sqle);
            }

            if (PRODUCT_ORACLE.equalsIgnoreCase(databaseProduct)) {
                vendor = JDBCDriverVendor.ORACLE8;
            } else if (databaseProduct != null && databaseProduct.regionMatches(
                            true, 0, PRODUCT_DB2, 0, PRODUCT_DB2.length())) {
                vendor = JDBCDriverVendor.DB2;
            } else if (PRODUCT_MSSQL.equalsIgnoreCase(databaseProduct)) {
                vendor = JDBCDriverVendor.MSSQL_JSQL;
            } else if (PRODUCT_SYBASE.equalsIgnoreCase(databaseProduct)) {
                vendor = JDBCDriverVendor.SYBASE;
            } else if (PRODUCT_POSTGRES.equalsIgnoreCase(databaseProduct)) {
                vendor = JDBCDriverVendor.POSTGRESQL;
            } else if (PRODUCT_HYPERSONIC.equalsIgnoreCase(databaseProduct)) {
                vendor = JDBCDriverVendor.HYPERSONIC;
            } else if (PRODUCT_MYSQL.equalsIgnoreCase(databaseProduct)) {
                vendor = JDBCDriverVendor.MYSQL;
            } else if (PRODUCT_DERBY.equalsIgnoreCase(databaseProduct)) {
                vendor = JDBCDriverVendor.DERBY_SERVER;
            } else {
                throw new JDBCRepositoryException(EXCEPTION_LOCALIZER.format(
                        "jdbc-unknown-vendor",
                        databaseProduct));
            }
        }
        return vendor;
View Full Code Here

                // vendor does not support unique selection so filter results
                return new UniqueStringEnumeration(rs);
            }
            return new StringEnumeration(rs);
        } catch (SQLException sqle) {
            throw new JDBCRepositoryException(sqle);
        }
    }
View Full Code Here

    protected static String getHost(MCSDriverConfiguration configuration)
            throws RepositoryException {

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

        return host;
    }
View Full Code Here

    protected static String getSource(MCSDriverConfiguration configuration)
            throws RepositoryException {

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

        return source;
    }
View Full Code Here

              } else {
                  connection = dataSource.getConnection(userName, password);
              }
          } catch (SQLException sqle) {
              logger.error("sql-exception", sqle);
              throw new JDBCRepositoryException(sqle);
          }
          if (logger.isDebugEnabled()) {
              logger.debug("Got database connection " + connection);
          }
      }
View Full Code Here

              logger.debug("Closed " + connection);
          }
      }
    }
    catch (SQLException sqle) {
      throw new JDBCRepositoryException (sqle);
    }
  }
View Full Code Here

      connection.setTransactionIsolation (isolationLevel);

      return true;
    }
    catch (SQLException sqle) {
      throw new JDBCRepositoryException (sqle);
    }
    // finally {
    // return false;
    // }
  }
View Full Code Here

      }

      return true;
    }
    catch (SQLException sqle) {
      throw new JDBCRepositoryException (sqle);
    }
  }
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.