ReportMill 11 API

com.reportmill.datasource
Class RMJDBCDataSource

java.lang.Object
  extended by com.reportmill.base.RMObject
      extended by com.reportmill.datasource.RMDataSource
          extended by com.reportmill.datasource.RMJDBCDataSource
All Implemented Interfaces:
com.reportmill.base.RMPropertyChanger, java.lang.Cloneable

public class RMJDBCDataSource
extends RMDataSource

This class provides a datasource representing a JDBC database fetch.


Constructor Summary
RMJDBCDataSource()
          Creates a new RMDataSource JDBC.
 
Method Summary
 void addFetch(RMFetch aFetch)
          Adds a fetch to datasource.
 void cancelStatement()
          Interrupt the currently executing statement.
 void close()
          Call this to explicitly close the database connection.
 boolean equals(java.lang.Object anObj)
          Standard equals implementation.
 java.sql.ResultSet executeQuery(java.lang.String aQuery)
          Returns a result set for given query string.
 java.sql.ResultSet executeQuery(java.lang.String aQuery, int aFetchLimit)
          Returns a result set for given query string limited to given fetch limit number of rows.
 java.lang.Object fromXML(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
          XML unarchival.
 java.sql.Connection getConnection()
          Returns a database connection for this datasource.
 java.lang.String getConnectionURL()
          Returns the connection info URL.
 RMSchema getDatabaseSchema()
          Returns a schema for this datasource's database.
 java.util.Map getDataset()
          Returns the dataset for this datasource.
 java.lang.String getDriverClassName()
          Returns the driver class name.
 java.lang.String getError()
          Returns any error string from datasource reload.
 RMFetch getFetch(int anIndex)
          Returns the individual fetch at the given index.
 int getFetchCount()
          Returns the number of fetches for this datasource.
 java.lang.String getPassword()
          Returns the password.
 RMSchema getSchema()
          Returns the schema for this datasource's dataset.
 java.lang.String getUserName()
          Returns the user name.
 boolean isConnected()
          Returns whether datasource is currently connected to db.
 void refresh()
          Refreshes datatset (just by clearing it to force a refetch).
 RMFetch removeFetch(int anIndex)
          Removes a fetch from datasource.
 void setConnectionURL(java.lang.String aURL)
          Sets the connection info URL.
 void setDriverClassName(java.lang.String aName)
          Sets the driver class name.
 void setError(java.lang.String anError)
          Sets any error string from datasource reload.
 void setPassword(java.lang.String aPassword)
          Sets the password.
 void setUserName(java.lang.String aName)
          Sets the user name.
 com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver, java.lang.Object anOwner)
          XML archival.
 
Methods inherited from class com.reportmill.datasource.RMDataSource
createObject, getDataset, getDataset, getEntity, getName, hasChanges, isReadOnly, setName, toString
 
Methods inherited from class com.reportmill.base.RMObject
addListener, addPropertyChangeListener, animUpdate, clone, firePropertyChange, firePropertyChange, getListener, getListenerCount, getListeners, isFirePropertyChangeEnabled, isUndoing, removeListener, removePropertyChangeListener, setFirePropertyChangeEnabled, setUndoing
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RMJDBCDataSource

public RMJDBCDataSource()
Creates a new RMDataSource JDBC.

Method Detail

getDriverClassName

public java.lang.String getDriverClassName()
Returns the driver class name.


setDriverClassName

public void setDriverClassName(java.lang.String aName)
Sets the driver class name.


getConnectionURL

public java.lang.String getConnectionURL()
Returns the connection info URL.


setConnectionURL

public void setConnectionURL(java.lang.String aURL)
Sets the connection info URL.


getUserName

public java.lang.String getUserName()
Returns the user name.


setUserName

public void setUserName(java.lang.String aName)
Sets the user name.


getPassword

public java.lang.String getPassword()
Returns the password.


setPassword

public void setPassword(java.lang.String aPassword)
Sets the password.


getFetchCount

public int getFetchCount()
Returns the number of fetches for this datasource.


getFetch

public RMFetch getFetch(int anIndex)
Returns the individual fetch at the given index.


addFetch

public void addFetch(RMFetch aFetch)
Adds a fetch to datasource.


removeFetch

public RMFetch removeFetch(int anIndex)
Removes a fetch from datasource.


getSchema

public RMSchema getSchema()
Returns the schema for this datasource's dataset.

Specified by:
getSchema in class RMDataSource

getDataset

public java.util.Map getDataset()
Returns the dataset for this datasource.

Specified by:
getDataset in class RMDataSource

refresh

public void refresh()
Refreshes datatset (just by clearing it to force a refetch).

Overrides:
refresh in class RMDataSource

getError

public java.lang.String getError()
Returns any error string from datasource reload.

Overrides:
getError in class RMDataSource

setError

public void setError(java.lang.String anError)
Sets any error string from datasource reload.


isConnected

public boolean isConnected()
Returns whether datasource is currently connected to db.


close

public void close()
Call this to explicitly close the database connection.

Overrides:
close in class RMDataSource

getConnection

public java.sql.Connection getConnection()
Returns a database connection for this datasource.


executeQuery

public java.sql.ResultSet executeQuery(java.lang.String aQuery)
Returns a result set for given query string.


executeQuery

public java.sql.ResultSet executeQuery(java.lang.String aQuery,
                                       int aFetchLimit)
Returns a result set for given query string limited to given fetch limit number of rows.


cancelStatement

public void cancelStatement()
Interrupt the currently executing statement. (Let's hope the database supports it)


getDatabaseSchema

public RMSchema getDatabaseSchema()
Returns a schema for this datasource's database.


equals

public boolean equals(java.lang.Object anObj)
Standard equals implementation.

Overrides:
equals in class RMDataSource

toXML

public com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver,
                                               java.lang.Object anOwner)
XML archival.

Overrides:
toXML in class RMDataSource

fromXML

public java.lang.Object fromXML(com.reportmill.archiver.RXArchiver anArchiver,
                                com.reportmill.archiver.RXElement anElement,
                                java.lang.Object anOwner)
XML unarchival.

Overrides:
fromXML in class RMDataSource

ReportMill 11 API