Examples of DBConnectionInfo


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

        this.view = new DataSourceWizardView(this);
        this.view.setTitle(title);
        this.altDataSource = altDataSource;
        this.altDataSourceKey = altDataSourceKey;
        this.connectionInfo = new DBConnectionInfo();

        initBindings();
    }
View Full Code Here

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

    public void setDataSourceKey(String dataSourceKey) {
        this.dataSourceKey = dataSourceKey;

        // update a clone object that will be used to obtain connection...
        DBConnectionInfo currentInfo = (DBConnectionInfo) dataSources.get(dataSourceKey);
        if (currentInfo != null) {
            currentInfo.copyTo(connectionInfo);
        }
        else {
            connectionInfo = new DBConnectionInfo();
        }

        view.getConnectionInfo().setConnectionInfo(connectionInfo);
    }
View Full Code Here

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

    /**
     * Tests that the entered information is valid and can be used to open a conneciton.
     * Does not store the open connection.
     */
    public void okAction() {
        DBConnectionInfo info = getConnectionInfo();
        ClassLoadingService classLoader = getApplication().getClassLoadingService();

        // try making an adapter...
        try {
            info.makeAdapter(classLoader);
        }
        catch (Throwable th) {
            reportError("DbAdapter Error", th);
            return;
        }

        // doing connection testing...
        // attempt opening the connection, and close it right away
        try {
            Connection connection = info.makeDataSource(classLoader).getConnection();
            try {
                connection.close();
            }
            catch (SQLException ex) {
                // ignore close error
View Full Code Here

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

        super(getActionName(), application);
    }

    public void performAction(ActionEvent e) {

        DBConnectionInfo nodeInfo = preferredDataSource();
        String nodeKey = preferredDataSourceLabel(nodeInfo);

        DataSourceWizard connectWizard = new DataSourceWizard(
                getProjectController(),
                "Generate DB Schema: Connect to Database",
View Full Code Here

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

     * Overrides superclass to keep an open connection around for the caller's use.
     */
    public void okAction() {
        // build connection and adapter...

        DBConnectionInfo info = getConnectionInfo();
        ClassLoadingService classLoader = getApplication().getClassLoadingService();

        try {
            this.adapter = info.makeAdapter(classLoader);
        }
        catch (Throwable th) {
            reportError("DbAdapter Error", th);
            return;
        }

        try {
            this.connection = info.makeDataSource(classLoader).getConnection();
        }
        catch (Throwable th) {
            reportError("Connection Error", th);
            return;
        }
View Full Code Here

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

        if (key == null) {
            mainController.updateStatus("No Local DataSource selected for node...");
            return;
        }

        DBConnectionInfo dataSource = (DBConnectionInfo) parent
                .getApplicationPreferenceDomain()
                .getDetail(key, DBConnectionInfo.class, false);

        if (dataSource != null) {
            if (dataSource.copyTo(projectDS.getDataSourceInfo())) {
                refreshView();
                super.nodeChangeProcessor.modelUpdated(null, null, null);
                mainController.updateStatus(null);
            }
            else {
View Full Code Here

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

        // a slight chance that a real datasource is called NO_LOCAL_DATA_SOURCE...
        keys[0] = NO_LOCAL_DATA_SOURCE;
        Iterator it = sources.iterator();
        for (int i = 1; i <= len; i++) {
            DBConnectionInfo info = (DBConnectionInfo) it.next();
            keys[i] = info.getKey();
            localDataSources.put(keys[i], info);
        }

        view.getLocalDataSources().setModel(new DefaultComboBoxModel(keys));
        localDataSourceBinding.updateView();
View Full Code Here

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

        super(getActionName(), application);
    }

    public void performAction(ActionEvent e) {

        DBConnectionInfo nodeInfo = preferredDataSource();
        String nodeKey = preferredDataSourceLabel(nodeInfo);

        DataSourceWizard connectWizard = new DataSourceWizard(
                getProjectController(),
                "Generate DB Schema: Connect to Database",
View Full Code Here

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

        if (key == null) {
            mainController.updateStatus("No Local DataSource selected for node...");
            return;
        }

        DBConnectionInfo dataSource = (DBConnectionInfo) getApplication()
            .getCayenneProjectPreferences()
            .getDetailObject(DBConnectionInfo.class)
            .getObject(key);

        if (dataSource != null) {
            if (dataSource.copyTo(projectDSI)) {
                refreshView();
                super.nodeChangeProcessor.modelUpdated(null, null, null);
                mainController.updateStatus(null);
            }
            else {
View Full Code Here

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

        if (key == null) {
            mainController.updateStatus("No Local DataSource selected for node...");
            return;
        }

        DBConnectionInfo dataSource = (DBConnectionInfo) parent
                .getApplicationPreferenceDomain()
                .getDetail(key, DBConnectionInfo.class, false);

        if (dataSource != null) {
            if (dataSource.copyTo(projectDS.getDataSourceInfo())) {
                refreshView();
                super.nodeChangeProcessor.modelUpdated(null, null, null);
                mainController.updateStatus(null);
            }
            else {
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.