ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.xmlbind
Class DBSourceArray2D

java.lang.Object
  extended by umontreal.iro.lecuyer.xmlbind.DBSourceArray2D

public class DBSourceArray2D
extends Object

Represents a source array whose data is extracted from a database using JDBC. The elements of the array are obtained by performing a query on a database. Each row of the resulting result set is a row in the source array, while each column corresponding to a field of the result set becomes a column in the array. The JDBC connection is initialized using DBConnectionParam, and the result set is converted into an array of objects using JDBCManager.readObjectData2D(Connection,String). Any numeric object (instances of Number) is converted to the target class while other objects not corresponding to the target class are converted to string before they are passed to String).

In a XML file, the dataQuery attribute of an element representing a database-based source array is used to specify the query on the database. The database nested element is then used to describe the connection to the database.


Constructor Summary
DBSourceArray2D(DBConnectionParams dbParams)
           
DBSourceArray2D(Node node)
           
 
Method Summary
 void close()
           
 Connection getConnection()
          Returns the connection to the database.
 DBConnectionParams getDatabase()
          Returns the parameters of the database connection used to obtain data for this source array.
 SourceArray2D getQuery(String dataQuery)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBSourceArray2D

public DBSourceArray2D(DBConnectionParams dbParams)

DBSourceArray2D

public DBSourceArray2D(Node node)
Method Detail

getDatabase

public DBConnectionParams getDatabase()
Returns the parameters of the database connection used to obtain data for this source array.

Returns:
the database connection parameters.

getConnection

public Connection getConnection()
Returns the connection to the database.

Returns:
the current connection.

close

public void close()

getQuery

public SourceArray2D getQuery(String dataQuery)

ContactCenters
V. 0.9.9.

To submit a bug or ask questions, send an e-mail to Richard Simard.