public class SQLStatementDocument
extends javax.swing.text.PlainDocument
implements java.io.Serializable
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:
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
Constructor and Description |
---|
SQLStatementDocument()
Deprecated.
Constructs a SQLStatementDocument object.
|
SQLStatementDocument(SQLConnection connection,
java.lang.String text)
Deprecated.
Constructs a SQLStatementDocument object.
|
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.
|
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertString, insertUpdate, removeUpdate
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
public SQLStatementDocument()
public SQLStatementDocument(SQLConnection connection, java.lang.String text)
connection
- The SQL connection.text
- The text for the documentpublic void addActionCompletedListener(ActionCompletedListener listener)
listener
- The listener.public void addErrorListener(ErrorListener listener)
listener
- The listener.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener.public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The listener.public void addWorkingListener(WorkingListener listener)
listener
- The listener.public void execute()
public SQLConnection getConnection()
public void getMoreResults()
Refer to JDBC documentation for more information.
public java.sql.ResultSet getResultSet()
Refer to JDBC documentation for more information.
public java.lang.String getSQLStatement()
public int getUpdateCount()
Refer to JDBC documentation for more information.
public java.sql.SQLWarning getWarnings()
public void removeActionCompletedListener(ActionCompletedListener listener)
listener
- The listener.public void removeErrorListener(ErrorListener listener)
listener
- The listener.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener.public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The listener.public void removeWorkingListener(WorkingListener listener)
listener
- The listener.public void setConnection(SQLConnection connection) throws java.beans.PropertyVetoException
connection
- The SQL connection.java.beans.PropertyVetoException
- If the change is vetoed.