Class MediaItemDataAccess
- java.lang.Object
-
- nl.gx.webmanager.wcb.mediaitemtype.impl.MediaItemDataAccess
-
public class MediaItemDataAccess extends Object
This class handles all access to the external media repository database.
-
-
Constructor Summary
Constructors Constructor Description MediaItemDataAccess(DataSourceManager dbcpManager, ConfigurationManagement config)
Constructor of the media data access class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
doSingleSelectQuery(String selectStatement, Object[] args)
Executes a select statement on the database.int
doUpdateQueries(ArrayList<String> updateStatements, Object[] args)
Executes an update statement on the database.int
doUpdateQuery(String updateStatement, Object[] args)
Executes an update statement on the database.String
getMediaRepositoryDatabaseType()
Returns the database type of the media repository
-
-
-
Constructor Detail
-
MediaItemDataAccess
public MediaItemDataAccess(DataSourceManager dbcpManager, ConfigurationManagement config) throws ServiceNotFoundException, SQLException
Constructor of the media data access class.- Parameters:
dbcpManager
- The DBCPManager service- Throws:
ServiceNotFoundException
- Thrown when the DBCPManager service is not availableSQLException
- Thrown when an error occurs while executing SQL statement
-
-
Method Detail
-
getMediaRepositoryDatabaseType
public String getMediaRepositoryDatabaseType()
Returns the database type of the media repository- Returns:
- Type of the media repository, can be 'mssql', 'oracle' or 'mysql'
-
doUpdateQuery
public int doUpdateQuery(String updateStatement, Object[] args) throws SQLException, ServiceNotFoundException
Executes an update statement on the database.- Parameters:
updateStatement
- Statement to executeargs
- Arguments to use for the udpate query- Returns:
- Result id of the update query
- Throws:
SQLException
- Thrown when an error occurs while executing SQL statementServiceNotFoundException
-
doUpdateQueries
public int doUpdateQueries(ArrayList<String> updateStatements, Object[] args) throws SQLException, ServiceNotFoundException
Executes an update statement on the database.- Parameters:
updateStatement
- Statement to executeargs
- Arguments to use for the udpate query- Returns:
- Result id of the update query
- Throws:
SQLException
- Thrown when an error occurs while executing SQL statementServiceNotFoundException
-
doSingleSelectQuery
public int doSingleSelectQuery(String selectStatement, Object[] args) throws SQLException, ServiceNotFoundException
Executes a select statement on the database.- Parameters:
selectStatement
- Statement to executeargs
- Arguments to use for the udpate query- Returns:
- Resulting id of the select query
- Throws:
SQLException
- Thrown when an error occurs while executing SQL statementServiceNotFoundException
-
-