Package com.dci.intellij.dbn.database

Examples of com.dci.intellij.dbn.database.DatabaseMetadataInterface


        public boolean isValid() {
            long currentTimeMillis = System.currentTimeMillis();
            if (TimeUtil.isOlderThan(lastAccessTimestamp, TimeUtil.TEN_SECONDS)) {
                lastCheckTimestamp = currentTimeMillis;
                DatabaseMetadataInterface metadataInterface = connectionHandler.getInterfaceProvider().getMetadataInterface();
                isValid = metadataInterface.isValid(connection);
                return isValid;
            }
            return isValid;
        }
View Full Code Here


                GenericDataType genericDataType = dataType.getNativeDataType().getBasicDataType();
                if (genericDataType == GenericDataType.LITERAL) {
                    value = com.intellij.openapi.util.text.StringUtil.replace(value, "'", "''");
                    value = "'" + value + "'";
                } else if (genericDataType == GenericDataType.DATE_TIME) {
                    DatabaseMetadataInterface metadataInterface = connectionHandler.getInterfaceProvider().getMetadataInterface();
                    try {
                        Date date = regionalSettings.getFormatter().parseDateTime(value);
                        value = metadataInterface.createDateString(date);
                    } catch (ParseException e) {
                        try {
                            Date date = regionalSettings.getFormatter().parseDate(value);
                            value = metadataInterface.createDateString(date);
                        } catch (ParseException e1) {
                            // value can be something like "sysdate" => not parseable
                            //e1.printStackTrace();
                        }
                    }
View Full Code Here

                if (genericDataType == GenericDataType.LITERAL) {
                    value = StringUtil.replace(value, "'", "''");
                    value = "'" + value + "'" ;
                } else if (genericDataType == GenericDataType.DATE_TIME){
                    DatabaseMetadataInterface metadataInterface = connectionHandler.getInterfaceProvider().getMetadataInterface();
                    try {
                        Date date = regionalSettings.getFormatter().parseDateTime(value);
                        value = metadataInterface.createDateString(date);
                    } catch (ParseException e) {
                        try {
                            Date date = regionalSettings.getFormatter().parseDate(value);
                            value = metadataInterface.createDateString(date);
                        } catch (ParseException e1) {
                            addError(variable, "Invalid date");
                        }
                    }
                } else if (genericDataType == GenericDataType.NUMERIC){
View Full Code Here

        Connection connection = null;
        DatabaseCompilerManager compilerManager = DatabaseCompilerManager.getInstance(getProject());
        ConnectionHandler connectionHandler = object.getConnectionHandler();
        try {
            connection = connectionHandler.getPoolConnection();
            DatabaseMetadataInterface metadataInterface = connectionHandler.getInterfaceProvider().getMetadataInterface();

            boolean isDebug = compileType == CompileType.DEBUG;

            if (compileType == CompileType.KEEP) {
                isDebug = object.getStatus().is(DBObjectStatus.DEBUG);
            }

            if (contentType == DBContentType.CODE_SPEC || contentType == DBContentType.CODE) {
                metadataInterface.compileObject(
                            object.getSchema().getName(),
                            object.getName(),
                            object.getTypeName().toUpperCase(),
                            isDebug,
                            connection);
            }
            else if (contentType == DBContentType.CODE_BODY){
                metadataInterface.compileObjectBody(
                            object.getSchema().getName(),
                            object.getName(),
                            object.getTypeName().toUpperCase(),
                            isDebug,
                            connection);

            } else if (contentType == DBContentType.CODE_SPEC_AND_BODY) {
                metadataInterface.compileObject(
                            object.getSchema().getName(),
                            object.getName(),
                            object.getTypeName().toUpperCase(),
                            isDebug,
                            connection);
                metadataInterface.compileObjectBody(
                            object.getSchema().getName(),
                            object.getName(),
                            object.getTypeName().toUpperCase(),
                            isDebug,
                            connection);
View Full Code Here

        protected SpecSourceCodeLoader(DBObject object) {
            super(object, false);
        }

        public ResultSet loadSourceCode(Connection connection) throws SQLException {
            DatabaseMetadataInterface metadataInterface = getConnectionHandler().getInterfaceProvider().getMetadataInterface();
            return metadataInterface.loadObjectSourceCode(
                   getSchema().getName(), getName(), "PACKAGE", connection);
        }
View Full Code Here

        protected BodySourceCodeLoader(DBObject object) {
            super(object, true);
        }

        public ResultSet loadSourceCode(Connection connection) throws SQLException {
            DatabaseMetadataInterface metadataInterface = getConnectionHandler().getInterfaceProvider().getMetadataInterface();
            return metadataInterface.loadObjectSourceCode(getSchema().getName(), getName(), "PACKAGE BODY",connection);
        }
View Full Code Here

    @Override
    public DBOperationExecutor getOperationExecutor() {
        return new DBOperationExecutor() {
            public void executeOperation(DBOperationType operationType) throws SQLException, DBOperationNotSupportedException {
                Connection connection = getConnectionHandler().getStandaloneConnection(getSchema());
                DatabaseMetadataInterface metadataInterface = getConnectionHandler().getInterfaceProvider().getMetadataInterface();
                if (operationType == DBOperationType.ENABLE) {
                    metadataInterface.enableTrigger(getSchema().getName(), getName(), connection);
                    getStatus().set(DBObjectStatus.ENABLED, true);
                } else if (operationType == DBOperationType.DISABLE) {
                    metadataInterface.disableTrigger(getSchema().getName(), getName(), connection);
                    getStatus().set(DBObjectStatus.ENABLED, false);
                } else {
                    throw new DBOperationNotSupportedException(operationType, getObjectType());
                }
            }
View Full Code Here

        protected SourceCodeLoader(DBObject object) {
            super(object, false);
        }

        public ResultSet loadSourceCode(Connection connection) throws SQLException {
            DatabaseMetadataInterface metadataInterface = getConnectionHandler().getInterfaceProvider().getMetadataInterface();
            return metadataInterface.loadTriggerSourceCode(getDataset().getSchema().getName(), getDataset().getName(), getSchema().getName(), getName(), connection);
        }
View Full Code Here

    @Override
    public DBOperationExecutor getOperationExecutor() {
        return new DBOperationExecutor() {
            public void executeOperation(DBOperationType operationType) throws SQLException, DBOperationNotSupportedException {
                Connection connection = getConnectionHandler().getStandaloneConnection(getSchema());
                DatabaseMetadataInterface metadataInterface = getConnectionHandler().getInterfaceProvider().getMetadataInterface();
                if (operationType == DBOperationType.ENABLE) {
                    metadataInterface.enableConstraint(
                            getSchema().getName(),
                            getDataset().getName(),
                            getName(),
                            connection);
                    getStatus().set(DBObjectStatus.ENABLED, true);
                } else if (operationType == DBOperationType.DISABLE) {
                    metadataInterface.disableConstraint(
                            getSchema().getName(),
                            getDataset().getName(),
                            getName(),
                            connection);
                    getStatus().set(DBObjectStatus.ENABLED, false);
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.database.DatabaseMetadataInterface

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.