nl.gx.webmanager.wcb.mediaitemtype.impl
Class MediaItemDataAccess

java.lang.Object
  extended by nl.gx.webmanager.wcb.mediaitemtype.impl.MediaItemDataAccess

public class MediaItemDataAccess
extends java.lang.Object

This class handles all access to the external media repository database.

Author:
Ivo Ladage

Constructor Summary
MediaItemDataAccess(DataSourceManager dbcpManager, ConfigurationManagement config)
          Constructor of the media data access class.
 
Method Summary
 int doSingleSelectQuery(java.lang.String selectStatement, java.lang.Object[] args)
          Executes a select statement on the database.
 int doUpdateQueries(java.util.ArrayList<java.lang.String> updateStatements, java.lang.Object[] args)
          Executes an update statement on the database.
 int doUpdateQuery(java.lang.String updateStatement, java.lang.Object[] args)
          Executes an update statement on the database.
 java.lang.String getMediaRepositoryDatabaseType()
          Returns the database type of the media repository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaItemDataAccess

public MediaItemDataAccess(DataSourceManager dbcpManager,
                           ConfigurationManagement config)
                    throws javax.management.ServiceNotFoundException,
                           java.sql.SQLException
Constructor of the media data access class.

Parameters:
dbcpManager - The DBCPManager service
Throws:
javax.management.ServiceNotFoundException - Thrown when the DBCPManager service is not available
java.sql.SQLException - Thrown when an error occurs while executing SQL statement
Method Detail

getMediaRepositoryDatabaseType

public java.lang.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(java.lang.String updateStatement,
                         java.lang.Object[] args)
                  throws java.sql.SQLException,
                         javax.management.ServiceNotFoundException
Executes an update statement on the database.

Parameters:
updateStatement - Statement to execute
args - Arguments to use for the udpate query
Returns:
Result id of the update query
Throws:
java.sql.SQLException - Thrown when an error occurs while executing SQL statement
javax.management.ServiceNotFoundException

doUpdateQueries

public int doUpdateQueries(java.util.ArrayList<java.lang.String> updateStatements,
                           java.lang.Object[] args)
                    throws java.sql.SQLException,
                           javax.management.ServiceNotFoundException
Executes an update statement on the database.

Parameters:
updateStatement - Statement to execute
args - Arguments to use for the udpate query
Returns:
Result id of the update query
Throws:
java.sql.SQLException - Thrown when an error occurs while executing SQL statement
javax.management.ServiceNotFoundException

doSingleSelectQuery

public int doSingleSelectQuery(java.lang.String selectStatement,
                               java.lang.Object[] args)
                        throws java.sql.SQLException,
                               javax.management.ServiceNotFoundException
Executes a select statement on the database.

Parameters:
selectStatement - Statement to execute
args - Arguments to use for the udpate query
Returns:
Resulting id of the select query
Throws:
java.sql.SQLException - Thrown when an error occurs while executing SQL statement
javax.management.ServiceNotFoundException


Copyright © 2007-2011 GX Software BV. All Rights Reserved.