com.groupdocs.assembly.system.data

Class DataTable

  • java.lang.Object
    • com.groupdocs.assembly.system.data.DataTable
    • Constructor Detail

      • DataTable

        public DataTable()
        Initializes a new instance of the DataTable class with no arguments.
      • DataTable

        public DataTable(java.lang.String tableName)
        Initializes a new instance of the DataTable class with the specified table name.
        Parameters:
        tableName - The name to give the table. If tableName is null or an empty string, a default name is given when added to the DataTableCollection.
      • DataTable

        public DataTable(java.sql.ResultSet resultSet)
                  throws java.sql.SQLException
        Creates an object by wrapping the specified ResultSet. Attempts to retrieve the table name from the metadata of the first column of the ResultSet.
        Parameters:
        resultSet - data set
        Throws:
        java.sql.SQLException - if a database access error occurs or this method is
      • DataTable

        public DataTable(java.sql.ResultSet resultSet,
                         java.lang.String tableName)
                  throws java.sql.SQLException
        Creates an object by wrapping the specified ResultSet.
        Parameters:
        resultSet - data set
        tableName - name of the table
        Throws:
        java.sql.SQLException - if a database access error occurs or this method is
    • Method Detail

      • close

        public void close()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTableName

        public java.lang.String getTableName()
        Gets the name of the DataTable.
        Returns:
        The name of the DataTable.
      • setTableName

        public void setTableName(java.lang.String value)
        Sets the name of the DataTable.
        Parameters:
        value - The name of the DataTable.
      • containsColumn

        public boolean containsColumn(java.lang.String columnName)
        Deprecated. Please use getColumns().contains(String) method.
        Check whether the given column exists or not
        Parameters:
        columnName - name of the column
        Returns:
        true is column can be found by the given columnName
      • getColumnsCount

        public int getColumnsCount()
        Returns:
        columns count
      • getColumnName

        public java.lang.String getColumnName(int index)
        Analog for .Net DataTable.Columns[i].ColumnName
        Parameters:
        index - - column's index
        Returns:
        column's name by its index.
      • getResultSet

        public java.sql.ResultSet getResultSet()
        Returns the underlying Java ResultSet object. Ideally we would like to work with DataTable in .Net manner. But some users and even some ours sample code are using this property.
        Returns:
        the underlying ResultSet
      • getDataSet

        public DataSet getDataSet()
        Gets the DataSet to which this table belongs.
        Returns:
        The DataSet to which this table belongs.
      • getPrimaryKey

        public DataColumn[] getPrimaryKey()
        Gets an array of columns that function as primary keys for the data table.
        Returns:
        An array of DataColumn objects.
      • getNamespace

        public java.lang.String getNamespace()
        Gets the namespace for the XML representation of the data stored in the DataTable.
        Returns:
        The namespace of the DataTable.
      • setNamespace

        public void setNamespace(java.lang.String value)
        Sets the namespace for the XML representation of the data stored in the DataTable.
        Parameters:
        value - The namespace of the DataTable.
      • getEnforceConstraints

        public boolean getEnforceConstraints()
        Returns:
        flag which indicates whether check constraint violation or not
      • setEnforceConstraints

        public void setEnforceConstraints(boolean enforceConstraints)
        Parameters:
        enforceConstraints - is the flag which indicates whether check constraint violation or not
      • refresh

        public void refresh()
        Reloads all the data from ResultSet if it is present.
      • acceptChanges

        public void acceptChanges()
                           throws java.sql.SQLException
        Commits all the changes made to this table since the last time acceptChanges() was called.
        Throws:
        java.sql.SQLException
      • clearEventListneers

        public void clearEventListneers()