1 28 package net.sf.jasperreports.engine.util; 29 30 import net.sf.jasperreports.engine.JRException; 31 import net.sf.jasperreports.engine.query.JRQueryExecuterFactory; 32 33 39 public class JRQueryExecuterUtils 40 { 41 private static final JRSingletonCache cache = new JRSingletonCache(JRQueryExecuterFactory.class); 42 43 51 public static JRQueryExecuterFactory getQueryExecuterFactory(String language) throws JRException 52 { 53 String factoryClassName = JRProperties.getProperty(JRProperties.QUERY_EXECUTER_FACTORY_PREFIX + language); 54 if (factoryClassName == null) 55 { 56 throw new JRException("No query executer factory class registered for " + language + " queries. " + 57 "Create a propery named " + JRProperties.QUERY_EXECUTER_FACTORY_PREFIX + language + "."); 58 } 59 60 return (JRQueryExecuterFactory) cache.getCachedInstance(factoryClassName); 61 } 62 } 63 | Popular Tags |