Examples of JdbcConnectionPool


Examples of com.sun.enterprise.config.serverbeans.JdbcConnectionPool

     */
    public String getConnectionURLFromConfigForOracle() {

        String url = null;
        StringBuffer sb = new StringBuffer();
        JdbcConnectionPool pool = this.getHadbJdbcConnectionPoolFromConfig();
        if(pool == null)
            return null;
        if (pool.sizeElementProperty() > 0) {
            ElementProperty[] props = pool.getElementProperty();
            for (int i = 0; i < props.length; i++) {
                String name = props[i].getAttributeValue("name");
                String value = props[i].getAttributeValue("value");
                if (name.equalsIgnoreCase("URL")) {
                    sb.append(value);
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcConnectionPool

    * Get the connectionUser from domain.xml.
    */
    public String getConnectionUserFromConfig() {

        String user = null;
        JdbcConnectionPool pool = this.getHadbJdbcConnectionPoolFromConfig();
        if(pool == null) {
            return null;
        }
        if (pool.sizeElementProperty() > 0) {
            ElementProperty[] props = pool.getElementProperty();
            for (int i = 0; i < props.length; i++) {
                String name = props[i].getAttributeValue("name");
                String value = props[i].getAttributeValue("value");
                if (name.equalsIgnoreCase(USER_NAME)) {
                    user = value;
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcConnectionPool

    * Get the connectionPassword from domain.xml.
    */
    public String getConnectionPasswordFromConfig() {

        String password = null;
        JdbcConnectionPool pool = this.getHadbJdbcConnectionPoolFromConfig();
        if(pool == null)
            return null;
        if (pool.sizeElementProperty() > 0) {
            ElementProperty[] props = pool.getElementProperty();
            for (int i = 0; i < props.length; i++) {
                String name = props[i].getAttributeValue("name");
                String value = props[i].getAttributeValue("value");
                if (name.equalsIgnoreCase(PASSWORD)) {
                    password = value;
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcConnectionPool

     * Get the connectionURL from domain.xml.
     */
    public String getConnectionURLFromConfig() {
        String url = null;
        StringBuffer sb = new StringBuffer();
        JdbcConnectionPool pool = this.getHadbJdbcConnectionPoolFromConfig();
        if(pool == null)
            return null;
        if (pool.sizeElementProperty() > 0) {
            ElementProperty[] props = pool.getElementProperty();
            for (int i = 0; i < props.length; i++) {
                String name = props[i].getAttributeValue("name");
                String value = props[i].getAttributeValue("value");
                if (name.equalsIgnoreCase("serverList")) {
                    sb.append(HADB_CONNECTION_URL_PREFIX);
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcConnectionPool

        if(jdbcResource == null) {
            return null;
        }
               
        String poolName = jdbcResource.getPoolName();
        JdbcConnectionPool pool =
            resources.getJdbcConnectionPoolByName(poolName);
        return pool;
    }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcConnectionPool

        if(beanName!=null) {
               String name = ccce.getName();
               return testSave(name,(String)value);
        }
       
        JdbcConnectionPool pool = (JdbcConnectionPool)value;
        String poolName = pool.getName();
       
        // check if connction pool name is valid object name Bug : 4698687 : start
        if(StaticTest.checkObjectName(poolName, result))
            result.passed("Valid Object Name");
        else {
            result.failed("Connection Pool Name Invalid ");
            return result;
        }
        // End Bug : 4698687
       
        String datasourceClassname = pool.getDatasourceClassname();
       
        // to be uncommented once warning is implemented
        /*if(isInValidDataSource(result, datasourceClassname))
            return result;*/
       
        if (choice != null && choice.equals("DELETE")){
            try{
                    // 8.0 XML Verifier
                    //Server server = (Server)context.getRootConfigBean();
                    //Resources resource = server.getResources();
                    Domain domain = (Domain)context.getRootConfigBean();
                    Resources resource = domain.getResources();
                    JdbcResource[] jdbcResource = resource.getJdbcResource();
                    if(jdbcResource.length == 0)
                            result.passed("Connect Pool not used by data source");
                    for(int i=0;i<jdbcResource.length;i++){
                        if(jdbcResource[i].getPoolName().equals(poolName)) {
                                result.failed("Connection Pool Used by Existing data source, cannot delete pool");
                                break;
                        }
                        else
                               result.passed("Connect Pool not used by data source");
                    }
            }
            catch(Exception e) {
            }
        }
        else {
                 if(pool.isIsConnectionValidationRequired() && pool.getConnectionValidationMethod().equals("table")) {
                        if(pool.getValidationTableName() == null || pool.getValidationTableName().equals(""))
                               result.failed("Required Table Name if Connection validation method is Table");
                        else
                               result.passed("Validation Table Name");
                }
                else
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcConnectionPool

    public void validate(ValidationContext valCtx) {
        super.validate(valCtx); // Before doing custom validation do basic validation
       
        if(valCtx.isVALIDATE() || valCtx.isADD() || valCtx.isSET())
        {
            JdbcConnectionPool pool = (JdbcConnectionPool)valCtx.getTargetBean();
            if(pool.isIsConnectionValidationRequired() && pool.getConnectionValidationMethod().equals("table")) {
                if(pool.getValidationTableName() == null || pool.getValidationTableName().equals(""))
                    reportValidationError(valCtx, "requiredTableName",
                    "Table Name is required Jdbc Connection Pool if Connection validation method is Table",
                    null);
            }
            checkLazyConnectionProps(valCtx);
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcConnectionPool

        if (poolName == null) {
            return list;
        }

        Resources root = ((Domain)_ctx.getRootConfigBean()).getResources();
        JdbcConnectionPool pool = root.getJdbcConnectionPoolByName(poolName);

        // no pool found
        if (pool == null) {
            return list;
        }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcConnectionPool

    public boolean isValid(final ResourcePool pool,
        final ConstraintValidatorContext constraintValidatorContext) {

        if(poolFaults == ConnectionPoolErrorMessages.MAX_STEADY_INVALID) {
            if(pool instanceof JdbcConnectionPool) {
                JdbcConnectionPool jdbcPool = (JdbcConnectionPool) pool;
                String maxPoolSize = jdbcPool.getMaxPoolSize();
                String steadyPoolSize = jdbcPool.getSteadyPoolSize();
                if(steadyPoolSize == null) {
                    steadyPoolSize = Constants.DEFAULT_STEADY_POOL_SIZE;
                }
                if (maxPoolSize == null) {
                    maxPoolSize = Constants.DEFAULT_MAX_POOL_SIZE;
                }
                if (Integer.parseInt(maxPoolSize) <
                        (Integer.parseInt(steadyPoolSize))) {
                    //max pool size fault
                    return false;
                }
            } else if(pool instanceof ConnectorConnectionPool) {
                ConnectorConnectionPool connPool = (ConnectorConnectionPool) pool;
                String maxPoolSize = connPool.getMaxPoolSize();
                String steadyPoolSize = connPool.getSteadyPoolSize();
                if(steadyPoolSize == null) {
                    steadyPoolSize = Constants.DEFAULT_STEADY_POOL_SIZE;
                }
                if (maxPoolSize == null) {
                    maxPoolSize = Constants.DEFAULT_MAX_POOL_SIZE;
                }
                if (Integer.parseInt(maxPoolSize) <
                        (Integer.parseInt(steadyPoolSize))) {
                    //max pool size fault
                    return false;
                }               
            }
        }
       
        if(poolFaults == ConnectionPoolErrorMessages.STMT_WRAPPING_DISABLED) {
            if(pool instanceof JdbcConnectionPool) {
                JdbcConnectionPool jdbcPool = (JdbcConnectionPool) pool;
                String stmtCacheSize = jdbcPool.getStatementCacheSize();
                String stmtLeakTimeout = jdbcPool.getStatementLeakTimeoutInSeconds();
                if (jdbcPool.getSqlTraceListeners() != null) {
                    if (!Boolean.valueOf(jdbcPool.getWrapJdbcObjects())) {
                        return false;
                    }
                }
                if (stmtCacheSize != null && Integer.valueOf(stmtCacheSize) != 0) {
                    if (!Boolean.valueOf(jdbcPool.getWrapJdbcObjects())) {
                        return false;
                    }
                }
                if (stmtLeakTimeout != null && Integer.valueOf(stmtLeakTimeout) != 0) {
                    if (!Boolean.valueOf(jdbcPool.getWrapJdbcObjects())) {
                        return false;
                    }
                }
                if (Boolean.valueOf(jdbcPool.getStatementLeakReclaim())) {
                    if (!Boolean.valueOf(jdbcPool.getWrapJdbcObjects())) {
                        return false;
                    }
                }
            }
        }

        if(poolFaults == ConnectionPoolErrorMessages.TABLE_NAME_MANDATORY){
            if(pool instanceof JdbcConnectionPool){
                JdbcConnectionPool jdbcPool = (JdbcConnectionPool) pool;
                if (Boolean.valueOf(jdbcPool.getIsConnectionValidationRequired())) {
                    if ("table".equals(jdbcPool.getConnectionValidationMethod())) {
                        if(jdbcPool.getValidationTableName() == null || jdbcPool.getValidationTableName().equals("")){
                            return false;
                        }
                    }
                }
            }
        }

        if(poolFaults == ConnectionPoolErrorMessages.CUSTOM_VALIDATION_CLASS_NAME_MANDATORY){
            if(pool instanceof JdbcConnectionPool){
                JdbcConnectionPool jdbcPool = (JdbcConnectionPool) pool;
                if (Boolean.valueOf(jdbcPool.getIsConnectionValidationRequired())) {
                    if ("custom-validation".equals(jdbcPool.getConnectionValidationMethod())) {
                        if(jdbcPool.getValidationClassname() == null || jdbcPool.getValidationClassname().equals("")){
                            return false;
                        }
                    }
                }
            }
        }

        if (poolFaults == ConnectionPoolErrorMessages.RES_TYPE_MANDATORY) {
            if (pool instanceof JdbcConnectionPool) {
                JdbcConnectionPool jdbcPool = (JdbcConnectionPool) pool;
                String resType = jdbcPool.getResType();
                String dsClassName = jdbcPool.getDatasourceClassname();
                String driverClassName = jdbcPool.getDriverClassname();
                if (resType == null) {
                    //One of datasource/driver classnames must be provided.
                    if ((dsClassName == null || dsClassName.equals("")) &&
                            (driverClassName == null || driverClassName.equals(""))) {
                        return false;
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.connection.JDBCConnectionPool

    public void init() {
        LegacyWindow mainWindow = new LegacyWindow("Test Application");
        setMainWindow(mainWindow);

        try {
            JDBCConnectionPool connectionPool = new SimpleJDBCConnectionPool(
                    "org.hsqldb.jdbc.JDBCDriver",
                    "jdbc:hsqldb:mem:sqlcontainer", "SA", "", 2, 20);

            createTestTable(connectionPool);
            insertTestData(connectionPool);
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.