Package net.sf.jasperreports.data.jdbc
Class JdbcDataAdapterService
- java.lang.Object
-
- net.sf.jasperreports.data.AbstractDataAdapterService
-
- net.sf.jasperreports.data.AbstractClasspathAwareDataAdapterService
-
- net.sf.jasperreports.data.jdbc.JdbcDataAdapterService
-
- All Implemented Interfaces:
DataAdapterService,ParameterContributor
- Direct Known Subclasses:
MondrianDataAdapterService
public class JdbcDataAdapterService extends AbstractClasspathAwareDataAdapterService
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static StringEXCEPTION_MESSAGE_KEY_CONNECTION_NOT_CREATEDstatic StringEXCEPTION_MESSAGE_KEY_INVALID_URLstatic StringEXCEPTION_MESSAGE_KEY_PASSWORD_REQUIRED-
Fields inherited from class net.sf.jasperreports.data.AbstractClasspathAwareDataAdapterService
CURRENT_CLASS_LOADER
-
Fields inherited from class net.sf.jasperreports.data.AbstractDataAdapterService
SECRETS_CATEGORY
-
-
Constructor Summary
Constructors Constructor Description JdbcDataAdapterService(ParameterContributorContext paramContribContext, JdbcDataAdapter jdbcDataAdapter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontributeParameters(Map<String,Object> parameters)voiddispose()protected BooleangetAutoCommit(JdbcDataAdapter dataAdapter, JRPropertiesUtil props, JRDataset dataset)ConnectiongetConnection()JdbcDataAdaptergetJdbcDataAdapter()StringgetPassword()protected BooleangetReadOnly(JdbcDataAdapter dataAdapter, JRPropertiesUtil props, JRDataset dataset)protected IntegergetTransactionIsolation(JdbcDataAdapter dataAdapter, JRPropertiesUtil props, JRDataset dataset)protected StringgetUrlForConnection()Some custom JDBC data adapters might require to tweak at runtime the URL information used to create the connection.protected voidsetupConnection(JdbcDataAdapter dataAdapter)-
Methods inherited from class net.sf.jasperreports.data.AbstractClasspathAwareDataAdapterService
getClassLoader, getPathClassloader
-
Methods inherited from class net.sf.jasperreports.data.AbstractDataAdapterService
getDataAdapter, getJasperReportsContext, getName, getParameterContributorContext, setDataAdapter, setName, test
-
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_PASSWORD_REQUIRED
public static final String EXCEPTION_MESSAGE_KEY_PASSWORD_REQUIRED
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_INVALID_URL
public static final String EXCEPTION_MESSAGE_KEY_INVALID_URL
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_CONNECTION_NOT_CREATED
public static final String EXCEPTION_MESSAGE_KEY_CONNECTION_NOT_CREATED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JdbcDataAdapterService
public JdbcDataAdapterService(ParameterContributorContext paramContribContext, JdbcDataAdapter jdbcDataAdapter)
-
-
Method Detail
-
getJdbcDataAdapter
public JdbcDataAdapter getJdbcDataAdapter()
-
contributeParameters
public void contributeParameters(Map<String,Object> parameters) throws JRException
- Specified by:
contributeParametersin interfaceParameterContributor- Specified by:
contributeParametersin classAbstractDataAdapterService- Throws:
JRException
-
getUrlForConnection
protected String getUrlForConnection()
Some custom JDBC data adapters might require to tweak at runtime the URL information used to create the connection.- Returns:
- the custom (if needed) data adapter URL
-
getConnection
public Connection getConnection() throws SQLException
- Throws:
SQLException
-
setupConnection
protected void setupConnection(JdbcDataAdapter dataAdapter) throws SQLException
- Throws:
SQLException
-
getAutoCommit
protected Boolean getAutoCommit(JdbcDataAdapter dataAdapter, JRPropertiesUtil props, JRDataset dataset)
-
getReadOnly
protected Boolean getReadOnly(JdbcDataAdapter dataAdapter, JRPropertiesUtil props, JRDataset dataset)
-
getTransactionIsolation
protected Integer getTransactionIsolation(JdbcDataAdapter dataAdapter, JRPropertiesUtil props, JRDataset dataset)
-
getPassword
public String getPassword() throws JRException
- Throws:
JRException
-
dispose
public void dispose()
- Specified by:
disposein interfaceParameterContributor- Overrides:
disposein classAbstractDataAdapterService
-
-