Package net.sf.jasperreports.data.jdbc
Class JdbcDataAdapterService
- java.lang.Object
-
- net.sf.jasperreports.dataadapters.AbstractDataAdapterService
-
- net.sf.jasperreports.dataadapters.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 String
EXCEPTION_MESSAGE_KEY_CONNECTION_NOT_CREATED
static String
EXCEPTION_MESSAGE_KEY_INVALID_URL
static String
EXCEPTION_MESSAGE_KEY_PASSWORD_REQUIRED
-
Fields inherited from class net.sf.jasperreports.dataadapters.AbstractClasspathAwareDataAdapterService
CURRENT_CLASS_LOADER
-
Fields inherited from class net.sf.jasperreports.dataadapters.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 void
contributeParameters(Map<String,Object> parameters)
void
dispose()
protected Boolean
getAutoCommit(JdbcDataAdapter dataAdapter, JRPropertiesUtil props, JRDataset dataset)
Connection
getConnection()
JdbcDataAdapter
getJdbcDataAdapter()
String
getPassword()
protected Boolean
getReadOnly(JdbcDataAdapter dataAdapter, JRPropertiesUtil props, JRDataset dataset)
protected Integer
getTransactionIsolation(JdbcDataAdapter dataAdapter, JRPropertiesUtil props, JRDataset dataset)
protected String
getUrlForConnection()
Some custom JDBC data adapters might require to tweak at runtime the URL information used to create the connection.protected void
setupConnection(JdbcDataAdapter dataAdapter)
-
Methods inherited from class net.sf.jasperreports.dataadapters.AbstractClasspathAwareDataAdapterService
getClassLoader, getPathClassloader
-
Methods inherited from class net.sf.jasperreports.dataadapters.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:
contributeParameters
in interfaceParameterContributor
- Specified by:
contributeParameters
in 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:
dispose
in interfaceParameterContributor
- Overrides:
dispose
in classAbstractDataAdapterService
-
-