|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.text.AbstractDocument javax.swing.text.PlainDocument com.ibm.as400.vaccess.SQLStatementDocument
public class SQLStatementDocument extends PlainDocument implements 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:
Modifier and Type | Class and Description |
---|
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument |
---|
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement |
Modifier and Type | Field and Description |
---|
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 and Description |
---|
SQLStatementDocument()
Deprecated. Constructs a SQLStatementDocument object. |
SQLStatementDocument(SQLConnection connection,
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(PropertyChangeListener listener)
Deprecated. Adds a listener to be notified when the value of any bound property is changed. |
void |
addVetoableChangeListener(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. |
ResultSet |
getResultSet()
Deprecated. Returns the current results of the last SQL statement run. |
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. |
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(PropertyChangeListener listener)
Deprecated. Removes a listener from being notified when the value of any bound property is changed. |
void |
removeVetoableChangeListener(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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SQLStatementDocument()
public SQLStatementDocument(SQLConnection connection, String text)
connection
- The SQL connection.text
- The text for the documentMethod Detail |
---|
public void addActionCompletedListener(ActionCompletedListener listener)
listener
- The listener.public void addErrorListener(ErrorListener listener)
listener
- The listener.public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The listener.public void addVetoableChangeListener(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 ResultSet getResultSet()
Refer to JDBC documentation for more information.
public String getSQLStatement()
public int getUpdateCount()
Refer to JDBC documentation for more information.
public SQLWarning getWarnings()
public void removeActionCompletedListener(ActionCompletedListener listener)
listener
- The listener.public void removeErrorListener(ErrorListener listener)
listener
- The listener.public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The listener.public void removeVetoableChangeListener(VetoableChangeListener listener)
listener
- The listener.public void removeWorkingListener(WorkingListener listener)
listener
- The listener.public void setConnection(SQLConnection connection) throws PropertyVetoException
connection
- The SQL connection.PropertyVetoException
- If the change is vetoed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |