Documentation of 'de.erichseifert.gral.data.JdbcData' Java class
JdbcData
de.erichseifert.gral.data

Class JdbcData

  • All Implemented Interfaces:
    DataSource, java.io.Serializable, java.lang.Iterable<java.lang.Comparable<?>>


    public class JdbcData
    extends AbstractDataSource
    Data source for database tables accessed through a JDBC connection.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      JdbcData(java.sql.Connection connection, java.lang.String table)
      Initializes a new buffered instance to query the data from a specified table using a specified JDBC connection.
      JdbcData(java.sql.Connection connection, java.lang.String table, boolean buffered)
      Initializes a new instance to query the data from a specified table using a specified JDBC connection.
    • Constructor Detail

      • JdbcData

        public JdbcData(java.sql.Connection connection,
                        java.lang.String table,
                        boolean buffered)
        Initializes a new instance to query the data from a specified table using a specified JDBC connection. It is assumed the table columns are constant during the connection.
        Parameters:
        connection - JDBC connection object.
        table - Properly quoted name of the table.
        buffered - Turns on buffering of JDBC queries.
      • JdbcData

        public JdbcData(java.sql.Connection connection,
                        java.lang.String table)
        Initializes a new buffered instance to query the data from a specified table using a specified JDBC connection.
        Parameters:
        connection - JDBC connection object.
        table - Properly quoted name of the table.
    • Method Detail

      • get

        public java.lang.Comparable<?> get(int col,
                                           int row)
        Returns the row with the specified index.
        Parameters:
        col - index of the column to return
        row - index of the row to return
        Returns:
        the specified value of the data cell
      • getRowCount

        public int getRowCount()
        Returns the number of rows of the data source.
        Returns:
        number of rows in the data source.
      • isBuffered

        public boolean isBuffered()
        Returns whether this data source is buffered.
        Returns:
        true when this object uses buffering, false otherwise
      • setBuffered

        public void setBuffered(boolean buffered)
        Determines whether this data source should buffer intermediate results. This implies that the data doesn't change during access.
        Parameters:
        buffered - true when this object should use buffering, false otherwise

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.