Package org.webcamp.settings.dto

Examples of org.webcamp.settings.dto.Settings


public class SettingsDaoImpl extends JdbcTemplate implements SettingsDao {

  @Override
  public Settings loadSettings() {
    Settings res = new Settings();
    Connection conn = null;
    try {
      conn = getDataSource().getConnection();

      PreparedStatement ps = conn.prepareStatement("select name, value from settings");
      ResultSet rs = ps.executeQuery();
      while (rs.next()) {
        String name = rs.getString("name");
        String value = rs.getString("value");
        res.setSetting(name, value);
      }
      System.out.println("Settings were loaded");
      return res;
    } catch (SQLException e) {
      throw new RuntimeException(e);
View Full Code Here


    return settingsDao.loadSettings();
  }

  @Override
  public void setSettings(String name, String value) {
    Settings s = settingsDao.loadSettings();
    s.setSetting(name, value);
    settingsDao.saveSettings(s);
  }
View Full Code Here

TOP

Related Classes of org.webcamp.settings.dto.Settings

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.