Package com.darwinsys.database

Examples of com.darwinsys.database.DataBaseException


      if (st != null)
        st.close();
      if (conn != null)
        conn.close();
    } catch (SQLException e) {
      throw new DataBaseException("Cleanup caught exception: " + e);
    }
  }
View Full Code Here


      } else for (int i = go.getOptInd()-1; i < args.length; i++) {
        runScript(prog, args[i]);
      }
      prog.close();
    } catch (SQLException ex) {
      throw new DataBaseException(ex.toString());
    } catch (IOException ex) {
      throw new DataBaseException(ex.toString());
    } catch (ClassNotFoundException ex) {
      throw new DataBaseException(ex.toString());
    }
    System.exit(0);
  }
View Full Code Here

        inputStream = new FileInputStream(configFileName);
      }
      p.load(new FileInputStream(configFileName));
      return getConfiguration(p, config);
    } catch (IOException ex) {
      throw new DataBaseException(ex.toString());
    } finally {
      if (inputStream != null) {
        try {
          inputStream.close();
        } catch (IOException stupidException) {
View Full Code Here

    final String db_url = p.getProperty(config  + "." + "DBURL");
    final String db_driver = p.getProperty(config  + "." + "DBDriver");
    final String db_user = p.getProperty(config  + "." + "DBUser");
    final String db_password = p.getProperty(config  + "." + "DBPassword");
    if (db_driver == null || db_url == null) {
      throw new DataBaseException("Driver or URL null: " + config);
    }
    return new SimpleSQLConfiguration(config, db_url, db_driver, db_user, db_password);
  }
View Full Code Here

    try {
      final Properties p = new Properties();
      p.load(new FileInputStream(configFileName));
      return getConnection(p, configName);
    } catch (IOException ex) {
      throw new DataBaseException(ex.toString());
    }
  }
View Full Code Here

      String db_url = p.getProperty(configName  + "." + "DBURL");
      String db_driver = p.getProperty(configName  + "." + "DBDriver");
      String db_user = p.getProperty(configName  + "." + "DBUser");
      String db_password = p.getProperty(configName  + "." + "DBPassword");
      if (db_driver == null || db_url == null) {
        throw new DataBaseException("Driver or URL null: " + configName);
      }
      return getConnection(db_url, db_driver, db_user, db_password);
    } catch (ClassNotFoundException ex) {
      throw new DataBaseException(ex.toString());

    } catch (SQLException ex) {
      throw new DataBaseException(ex.toString());
    }
  }
View Full Code Here

          continue;
        String configName = element.substring(0, offset);
        configNames.add(configName);
      }
    } catch (IOException ex) {
      throw new DataBaseException(ex.toString());
    }
    return configNames;
  }
View Full Code Here

  public Connection getConnection(Configuration config) {
    try {
      return ConnectionUtil.getConnection(config);
    } catch (Exception e) {
      throw new DataBaseException("Failed to get connection to " + config.getName(), e);
    }
  }
View Full Code Here

TOP

Related Classes of com.darwinsys.database.DataBaseException

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.