Package org.apache.tomcat.dbcp.dbcp

Examples of org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory


        datasource.setPoolProperties(p);
    }

    protected void transferProperties() {
        try {
            BasicDataSourceFactory factory = new BasicDataSourceFactory();
            Properties p = new Properties();

            for (int i=0; i<this.ALL_PROPERTIES.length; i++) {
                String name = "get" + Character.toUpperCase(ALL_PROPERTIES[i].charAt(0)) + ALL_PROPERTIES[i].substring(1);
                String bname = "is" + name.substring(3);
                Method get = null;
                try {
                    get = PoolProperties.class.getMethod(name, new Class[0]);
                }catch (NoSuchMethodException x) {
                    try {
                    get = PoolProperties.class.getMethod(bname, new Class[0]);
                    }catch (NoSuchMethodException x2) {
                        System.err.println(x2.getMessage());
                    }
                }
                   if (get!=null) {
                       Object value = get.invoke(datasource.getPoolProperties(), new Object[0]);
                       if (value!=null) {
                           p.setProperty(ALL_PROPERTIES[i], value.toString());
                       }
                }
            }
            tDatasource = (BasicDataSource)factory.createDataSource(p);
        }catch (Exception x) {
            x.printStackTrace();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory

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.