Package org.apache.cayenne.conn

Examples of org.apache.cayenne.conn.DataSourceInfo


        return new ProjectDataSource(this.getDriverInfo());
    }

    @Override
    protected DataSourceInfo getDriverInfo() {
        DataSourceInfo temp = super.getDriverInfo();
        if (null == temp) {
            temp = new DataSourceInfo();
        }

        return temp;
    }
View Full Code Here


     */
    public ConnectionProperties(ExtendedProperties props) {
        Iterator names = extractNames(props).iterator();
        while (names.hasNext()) {
            String name = (String) names.next();
            DataSourceInfo dsi = buildDataSourceInfo(props.subset(name));
            connectionInfos.put(name, dsi);
        }
    }
View Full Code Here

     */
    public DataSourceInfo getConnectionInfo(String name) {

        if (EMBEDDED_DATASOURCE.equals(name)) {
            // Create embedded data source instead
            DataSourceInfo connectionInfo = new DataSourceInfo();
            connectionInfo.setAdapterClassName(EMBEDDED_DATASOURCE_DBADAPTER);
            connectionInfo.setUserName(EMBEDDED_DATASOURCE_USERNAME);
            connectionInfo.setPassword(EMBEDDED_DATASOURCE_PASSWORD);
            connectionInfo.setDataSourceUrl(EMBEDDED_DATASOURCE_URL);
            connectionInfo.setJdbcDriver(EMBEDDED_DATASOURCE_JDBC_DRIVER);
            return connectionInfo;
        }

        synchronized (connectionInfos) {
            return (DataSourceInfo) connectionInfos.get(name);
View Full Code Here

    /**
     * Creates a DataSourceInfo object from a set of properties.
     */
    protected DataSourceInfo buildDataSourceInfo(ExtendedProperties props) {
        DataSourceInfo dsi = new DataSourceInfo();

        String adapter = props.getString(ADAPTER_KEY);
       
        // try legacy adapter key
        if(adapter == null) {
            adapter = props.getString(ADAPTER20_KEY);
        }
       
        dsi.setAdapterClassName(adapter);
        dsi.setUserName(props.getString(USER_NAME_KEY));
        dsi.setPassword(props.getString(PASSWORD_KEY));
        dsi.setDataSourceUrl(props.getString(URL_KEY));
        dsi.setJdbcDriver(props.getString(DRIVER_KEY));

        return dsi;
    }
View Full Code Here

        }

        public void init(String name, Attributes attrs) {
            String className = attrs.getValue("", "class");
            logger.info("loading driver " + className);
            driverInfo = new DataSourceInfo();
            driverInfo.setJdbcDriver(className);
        }
View Full Code Here

    public void validatePasswordEncoderAction()
    {
      if (node == null || node.getDataSource() == null)
        return;

      DataSourceInfo dsi = ((ProjectDataSource) node.getDataSource()).getDataSourceInfo();

      if (view.getPasswordEncoder().getSelectedItem().equals(dsi.getPasswordEncoderClass()) == false)
        return;

      if (dsi.getPasswordEncoder() == null)
      {
        JOptionPane.showMessageDialog(getView(),
                                      "A valid Password Encoder should be specified (check your CLASSPATH).",
                                      "Invalid Password Encoder",
                                      JOptionPane.ERROR_MESSAGE);
View Full Code Here

    public void passwordLocationChangedAction()
    {
      if (node == null || node.getDataSource() == null)
        return;

      DataSourceInfo dsi = ((ProjectDataSource) node.getDataSource()).getDataSourceInfo();

      String selectedItem = (String) view.getPasswordLocation().getSelectedItem();

      if (selectedItem.equals(DataSourceInfo.PASSWORD_LOCATION_CLASSPATH))
        updatePasswordElements(true, true, dsi.getPassword(), "Password Filename:", dsi.getPasswordSourceFilename());
      else if (selectedItem.equals(DataSourceInfo.PASSWORD_LOCATION_EXECUTABLE))
        updatePasswordElements(false, true, null, "Password Executable:", dsi.getPasswordSourceExecutable());
      else if (selectedItem.equals(DataSourceInfo.PASSWORD_LOCATION_MODEL))
        updatePasswordElements(true, false, dsi.getPassword(), "Password Source:", dsi.getPasswordSourceModel());
      else if (selectedItem.equals(DataSourceInfo.PASSWORD_LOCATION_URL))
        updatePasswordElements(false, true, null, "Password URL:", dsi.getPasswordSourceUrl());
    }
View Full Code Here

        return new ProjectDataSource(this.getDriverInfo());
    }

    protected DataSourceInfo getDriverInfo() {
        DataSourceInfo temp = super.getDriverInfo();
        if (null == temp) {
            temp = new DataSourceInfo();
        }

        return temp;
    }
View Full Code Here

        }

        public void init(String name, Attributes attrs) {
            String className = attrs.getValue("", "class");
            logObj.info( "loading driver " + className);
            driverInfo = new DataSourceInfo();
            driverInfo.setJdbcDriver(className);
        }
View Full Code Here

     */
    public ConnectionProperties(ExtendedProperties props) {
        Iterator names = extractNames(props).iterator();
        while (names.hasNext()) {
            String name = (String) names.next();
            DataSourceInfo dsi = buildDataSourceInfo(props.subset(name));
            connectionInfos.put(name, dsi);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.conn.DataSourceInfo

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.