private static void checkPoolPreparedStatements()

in appactive-java-client/client-bridge/client-bridge-db-mysql/src/main/java/io/appactive/db/mysql/utils/SQLCacheCheckUtil.java [70:84]


    private static void checkPoolPreparedStatements(MBeanServer mbeanServer, ObjectInstance dataSource,
                                  MBeanAttributeInfo mBeanAttributeInfo, String attributeInfoName)
        throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException {
        if ("PoolPreparedStatements".equals(attributeInfoName)) {
            Object val = mbeanServer.getAttribute(dataSource.getObjectName(), attributeInfoName);
            if (val != null && "boolean".equals(mBeanAttributeInfo.getType())) {
                Boolean v = (Boolean)val;
                if (v) {
                    String sb = "Druid datasource poolPreparedStatements:" + true
                        + " or MaxPoolPreparedStatementPerConnectionSize > 0, please set it manually!";
                    throw new RuntimeException(sb);
                }
            }
        }
    }