Examples of DBConnectionInfo


Examples of bin.repast.simphony.freezedry.datasource.DBConnectionInfo

      } else {
        password = descriptor.getPassword();
      }

      // check database connection:
      this.dbConInfo = new DBConnectionInfo(username, password, descriptor.getDbURL(), descriptor.getDriverName());
      // validateConnectionSettings();

      LOG.debug("CustomJdbcAppender: dbURL: " + descriptor.getDbURL());
      LOG.debug("CustomJdbcAppender: user: " + username);
      LOG.debug("CustomJdbcAppender: password: " + password);
View Full Code Here

Examples of bin.repast.simphony.freezedry.datasource.DBConnectionInfo

    testConnectionButton = new JButton("Test DB Connection");
    testConnectionButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        DBConnectionInfo dBInfo = new DBConnectionInfo(userNameField.getText(), new String(passwordField
            .getPassword()), urlField.getText(), driverField.getText());
        if (DBUtils.validateConnectionSettings(dBInfo, "")) {
          // store data back to wizard when connection was successful:
          userNameField.setText(dBInfo.userName);
          passwordField.setText(dBInfo.password);
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.DBConnectionInfo

     * Shows a dialog to create new local DataSource configuration.
     */
    public void newDataSourceAction() {

        DataSourceCreator creatorWizard = new DataSourceCreator(this);
        DBConnectionInfo dataSource = creatorWizard.startupAction();

        if (dataSource != null) {
            dataSources.put(creatorWizard.getName(), dataSource);

            Object[] keys = dataSources.keySet().toArray();
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.DBConnectionInfo

    public void duplicateDataSourceAction() {
        Object selected = view.getDataSources().getSelectedItem();
        if (selected != null) {
            DataSourceDuplicator wizard = new DataSourceDuplicator(this, selected
                    .toString());
            DBConnectionInfo dataSource = wizard.startupAction();

            if (dataSource != null) {
                dataSources.put(wizard.getName(), dataSource);

                Object[] keys = dataSources.keySet().toArray();
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.DBConnectionInfo

    /**
     * Tries to establish a DB connection, reporting the status of this operation.
     */
    public void testDataSourceAction() {
        DBConnectionInfo currentDataSource = getConnectionInfo();
        if (currentDataSource == null) {
            return;
        }

        if (currentDataSource.getJdbcDriver() == null) {
            JOptionPane.showMessageDialog(
                    null,
                    "No JDBC Driver specified",
                    "Warning",
                    JOptionPane.WARNING_MESSAGE);
            return;
        }

        if (currentDataSource.getUrl() == null) {
            JOptionPane.showMessageDialog(
                    null,
                    "No Database URL specified",
                    "Warning",
                    JOptionPane.WARNING_MESSAGE);
            return;
        }

        try {
            Class driverClass = getApplication().getClassLoadingService().loadClass(
                    currentDataSource.getJdbcDriver());
            Driver driver = (Driver) driverClass.newInstance();

            // connect via Cayenne DriverDataSource - it addresses some driver issues...
            Connection c = new DriverDataSource(
                    driver,
                    currentDataSource.getUrl(),
                    currentDataSource.getUserName(),
                    currentDataSource.getPassword()).getConnection();
            try {
                c.close();
            }
            catch (SQLException e) {
                // i guess we can ignore this...
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.DBConnectionInfo

    protected DBConnectionInfo createDataSource() {
        if (canceled) {
            return null;
        }

        DBConnectionInfo dataSource = (DBConnectionInfo) editor.createDetail(
                domain,
                getName(),
                DBConnectionInfo.class);

        Object adapter = view.getAdapters().getSelectedItem();
        if (NO_ADAPTER.equals(adapter)) {
            adapter = null;
        }

        if (adapter != null) {
            String adapterString = adapter.toString();
            dataSource.setDbAdapter(adapterString);

            // guess adapter defaults...
            AdapterMapping defaultMap = getApplication().getAdapterMapping();
            dataSource.setJdbcDriver(defaultMap.jdbcDriverForAdapter(adapterString));
            dataSource.setUrl(defaultMap.jdbcURLForAdapter(adapterString));
        }

        return dataSource;
    }
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.DBConnectionInfo

    protected DBConnectionInfo createDataSource() {
        if (canceled) {
            return null;
        }

        DBConnectionInfo prototype = (DBConnectionInfo) dataSources.get(prototypeKey);
        DBConnectionInfo dataSource = (DBConnectionInfo) editor.createDetail(
                domain,
                getName(),
                DBConnectionInfo.class);

        prototype.copyTo(dataSource);
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.DBConnectionInfo

        super(parent);

        this.dataMap = dataMap;
        this.tables = new TableSelectorController(parent);
        this.view = new DBGeneratorOptionsView(tables.getView());
        this.connectionInfo = new DBConnectionInfo();
        this.generatorDefaults = new DBGeneratorDefaults(parent
                .getPreferenceForProject()
                .node("DbGenerator"));

        this.view.setTitle(title);
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.DBConnectionInfo

                .getPreferenceDomainForDataDomain()
                .getDetail(node.getName(), DataNodeDefaults.class, false);

        String key = (nodeDefaults != null) ? nodeDefaults.getLocalDataSource() : null;
        if (key != null) {
            DBConnectionInfo info = (DBConnectionInfo) getApplication()
                    .getPreferenceDomain()
                    .getDetail(key, DBConnectionInfo.class, false);
            if (info != null) {
                return info;
            }
        }

        // extract data from the node
        if (!DriverDataSourceFactory.class.getName().equals(node.getDataSourceFactory())) {
            return null;
        }

        // create transient object..
        DBConnectionInfo nodeInfo = new DBConnectionInfo();

        nodeInfo.copyFrom(((ProjectDataSource) node.getDataSource()).getDataSourceInfo());

        nodeInfo.setDbAdapter(null);
        if (node.getAdapter() instanceof ModelerDbAdapter) {
            nodeInfo.setDbAdapter(((ModelerDbAdapter) node.getAdapter())
                    .getAdapterClassName());
        }

        return nodeInfo;
    }
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.DBConnectionInfo

     * asynchronously.
     */
    public void performAction(ActionEvent event) {

        // guess node connection
        DBConnectionInfo nodeInfo = preferredDataSource();
        String nodeKey = preferredDataSourceLabel(nodeInfo);

        // connect
        ConnectionWizard connectWizard = new ConnectionWizard(
                getProjectController(),
                "Reengineer DB Schema: Connect to Database",
                nodeKey,
                nodeInfo);

        if (!connectWizard.startupAction()) {
            // canceled
            return;
        }

        Connection connection = connectWizard.getConnection();
        DbAdapter adapter = connectWizard.getAdapter();
        DBConnectionInfo dataSourceInfo = connectWizard.getConnectionInfo();

        // from here pass control to DbLoaderHelper, running it from a thread separate
        // from EventDispatch

        final DbLoaderHelper helper = new DbLoaderHelper(
                getProjectController(),
                connection,
                adapter,
                dataSourceInfo.getUserName());
        Thread th = new Thread(new Runnable() {

            public void run() {
                helper.execute();
            }
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.