1 28 package net.sf.jasperreports.engine.query; 29 30 import java.util.Arrays ; 31 import java.util.Map ; 32 33 import net.sf.jasperreports.engine.JRDataset; 34 import net.sf.jasperreports.engine.JRException; 35 import net.sf.jasperreports.engine.util.JRProperties; 36 37 46 public class JRJdbcQueryExecuterFactory implements JRQueryExecuterFactory 47 { 48 51 public static final String PROPERTY_JDBC_FETCH_SIZE = JRProperties.PROPERTY_PREFIX + "jdbc.fetch.size"; 52 53 56 public static final String QUERY_LANGUAGE_SQL = "sql"; 57 58 59 private static final String [] queryParameterClassNames; 60 61 static 62 { 63 queryParameterClassNames = new String [] { 64 java.lang.Object .class.getName(), 65 java.lang.Boolean .class.getName(), 66 java.lang.Byte .class.getName(), 67 java.lang.Double .class.getName(), 68 java.lang.Float .class.getName(), 69 java.lang.Integer .class.getName(), 70 java.lang.Long .class.getName(), 71 java.lang.Short .class.getName(), 72 java.math.BigDecimal .class.getName(), 73 java.lang.String .class.getName(), 74 java.util.Date .class.getName(), 75 java.sql.Timestamp .class.getName(), 76 java.sql.Time .class.getName() }; 77 78 Arrays.sort(queryParameterClassNames); 79 } 80 81 public JRQueryExecuter createQueryExecuter(JRDataset dataset, Map parameters) throws JRException 82 { 83 return new JRJdbcQueryExecuter(dataset, parameters); 84 } 85 86 public Object [] getBuiltinParameters() 87 { 88 return null; 89 } 90 91 public boolean supportsQueryParameterType(String className) 92 { 93 return Arrays.binarySearch(queryParameterClassNames, className) >= 0; 94 } 95 } 96 | Popular Tags |