com.ibm.as400.vaccess

Class SQLStatementDocument

  • java.lang.Object
    • javax.swing.text.AbstractDocument
      • javax.swing.text.PlainDocument
        • com.ibm.as400.vaccess.SQLStatementDocument
  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.text.Document

    Deprecated. 
    Use Java Swing instead, along with the classes in package com.ibm.as400.access

    public class SQLStatementDocument
    extends javax.swing.text.PlainDocument
    implements java.io.Serializable
    The SQLStatementDocument class represents SQL statement that is issued when execute() is called.

    It is up to the user to register a JDBC driver when using this class. For example, the following code registers the IBM Toolbox for Java JDBC driver.

       DriverManager.registerDriver (new com.ibm.as400.access.AS400JDBCDriver ());
    

    Most errors are reported by firing ErrorEvents, rather than throwing exceptions. Users should listen for ErrorEvents in order to diagnose and recover from error conditions.

    SQLStatementDocument objects generate the following events:

    • ActionCompletedEvent
    • ErrorEvent
    • PropertyChangeEvent
    • DocumentEvent
    • WorkingEvent
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument

        javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement
    • Field Summary

      • Fields inherited from class javax.swing.text.PlainDocument

        lineLimitAttribute, tabSizeAttribute
      • Fields inherited from class javax.swing.text.AbstractDocument

        BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
      • Fields inherited from interface javax.swing.text.Document

        StreamDescriptionProperty, TitleProperty
    • Constructor Summary

      Constructors 
      Constructor and Description
      SQLStatementDocument()
      Deprecated. 
      Constructs a SQLStatementDocument object.
      SQLStatementDocument(SQLConnection connection, java.lang.String text)
      Deprecated. 
      Constructs a SQLStatementDocument object.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void addActionCompletedListener(ActionCompletedListener listener)
      Deprecated. 
      Adds a listener to be notified when a SQL statement is executed.
      void addErrorListener(ErrorListener listener)
      Deprecated. 
      Adds a listener to be notified when an error occurs.
      void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
      Deprecated. 
      Adds a listener to be notified when the value of any bound property is changed.
      void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
      Deprecated. 
      Adds a listener to be notified when the value of any constrained property is changed.
      void addWorkingListener(WorkingListener listener)
      Deprecated. 
      Adds a listener to be notified when work starts and stops on potentially long-running operations.
      void execute()
      Deprecated. 
      Runs the contents of this document as a SQL statement.
      SQLConnection getConnection()
      Deprecated. 
      Returns the SQL connection used to execute statements.
      void getMoreResults()
      Deprecated. 
      Makes the next result of the last statement run the current result.
      java.sql.ResultSet getResultSet()
      Deprecated. 
      Returns the current results of the last SQL statement run.
      java.lang.String getSQLStatement()
      Deprecated. 
      Returns the SQL statement that was last executed which the results in this object represent.
      int getUpdateCount()
      Deprecated. 
      Returns the number of rows affected by the last SQL statement run.
      java.sql.SQLWarning getWarnings()
      Deprecated. 
      Returns the warnings generated by the JDBC connection and statement.
      void removeActionCompletedListener(ActionCompletedListener listener)
      Deprecated. 
      Removes a listener from being notified when a SQL statement is issued.
      void removeErrorListener(ErrorListener listener)
      Deprecated. 
      Removes a listener from being notified when an error occurs.
      void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
      Deprecated. 
      Removes a listener from being notified when the value of any bound property is changed.
      void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
      Deprecated. 
      Removes a listener from being notified when the value of any constrained property is changed.
      void removeWorkingListener(WorkingListener listener)
      Deprecated. 
      Removes a listener from being notified when work starts and stops on potentially long-running operations.
      void setConnection(SQLConnection connection)
      Deprecated. 
      Sets the SQL connection used to execute statements.
      • Methods inherited from class javax.swing.text.PlainDocument

        createDefaultRoot, getDefaultRootElement, getParagraphElement, insertString, insertUpdate, removeUpdate
      • Methods inherited from class javax.swing.text.AbstractDocument

        addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SQLStatementDocument

        public SQLStatementDocument()
        Deprecated. 
        Constructs a SQLStatementDocument object.
      • SQLStatementDocument

        public SQLStatementDocument(SQLConnection connection,
                            java.lang.String text)
        Deprecated. 
        Constructs a SQLStatementDocument object.
        Parameters:
        connection - The SQL connection.
        text - The text for the document
    • Method Detail

      • addActionCompletedListener

        public void addActionCompletedListener(ActionCompletedListener listener)
        Deprecated. 
        Adds a listener to be notified when a SQL statement is executed. The listener's actionCompleted() method will be called.
        Parameters:
        listener - The listener.
      • addErrorListener

        public void addErrorListener(ErrorListener listener)
        Deprecated. 
        Adds a listener to be notified when an error occurs. The listener's errorOccurred() method will be called.
        Parameters:
        listener - The listener.
      • addPropertyChangeListener

        public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
        Deprecated. 
        Adds a listener to be notified when the value of any bound property is changed. The listener's propertyChange() method will be called.
        Parameters:
        listener - The listener.
      • addVetoableChangeListener

        public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
        Deprecated. 
        Adds a listener to be notified when the value of any constrained property is changed. The listener's vetoableChange() method will be called.
        Parameters:
        listener - The listener.
      • addWorkingListener

        public void addWorkingListener(WorkingListener listener)
        Deprecated. 
        Adds a listener to be notified when work starts and stops on potentially long-running operations.
        Parameters:
        listener - The listener.
      • execute

        public void execute()
        Deprecated. 
        Runs the contents of this document as a SQL statement.
      • getConnection

        public SQLConnection getConnection()
        Deprecated. 
        Returns the SQL connection used to execute statements.
        Returns:
        The SQL connection.
      • getMoreResults

        public void getMoreResults()
        Deprecated. 
        Makes the next result of the last statement run the current result. Nothing is done if no statement has been executed.

        Refer to JDBC documentation for more information.

      • getResultSet

        public java.sql.ResultSet getResultSet()
        Deprecated. 
        Returns the current results of the last SQL statement run. Multiple results can be obtained by calling getUpdateCount() and/or getResultSet() multiple times, with intervening getMoreResults() calls.

        Refer to JDBC documentation for more information.

        Returns:
        The result set or null if the result was not a result set, or if there are no results.
      • getSQLStatement

        public java.lang.String getSQLStatement()
        Deprecated. 
        Returns the SQL statement that was last executed which the results in this object represent.
        Returns:
        The SQL statement that the results in this object represent.
      • getUpdateCount

        public int getUpdateCount()
        Deprecated. 
        Returns the number of rows affected by the last SQL statement run. Multiple results can be obtained by calling getUpdateCount() and/or getResultSet() multiple times, with intervening getMoreResults() calls. If an error occurs, 0 is returned.

        Refer to JDBC documentation for more information.

        Returns:
        The number of rows that were affected. If no rows were affected or the SQL statement was a DDL command, 0 is returned. If there are no results or the results are a result set, -1 is returned.
      • getWarnings

        public java.sql.SQLWarning getWarnings()
        Deprecated. 
        Returns the warnings generated by the JDBC connection and statement. Each time the execute() is called (the SQL statement is run), the warnings are cleared. Connection warnings are only available after the first time a statement is executed. The warnings from the statement will be linked to the end of any connection warnings.
        Returns:
        The warnings generated by the connection and statement, or null if none.
      • removeActionCompletedListener

        public void removeActionCompletedListener(ActionCompletedListener listener)
        Deprecated. 
        Removes a listener from being notified when a SQL statement is issued.
        Parameters:
        listener - The listener.
      • removeErrorListener

        public void removeErrorListener(ErrorListener listener)
        Deprecated. 
        Removes a listener from being notified when an error occurs.
        Parameters:
        listener - The listener.
      • removePropertyChangeListener

        public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
        Deprecated. 
        Removes a listener from being notified when the value of any bound property is changed.
        Parameters:
        listener - The listener.
      • removeVetoableChangeListener

        public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
        Deprecated. 
        Removes a listener from being notified when the value of any constrained property is changed.
        Parameters:
        listener - The listener.
      • removeWorkingListener

        public void removeWorkingListener(WorkingListener listener)
        Deprecated. 
        Removes a listener from being notified when work starts and stops on potentially long-running operations.
        Parameters:
        listener - The listener.
      • setConnection

        public void setConnection(SQLConnection connection)
                           throws java.beans.PropertyVetoException
        Deprecated. 
        Sets the SQL connection used to execute statements. This property is bound and constrained.
        Parameters:
        connection - The SQL connection.
        Throws:
        java.beans.PropertyVetoException - If the change is vetoed.