É A PRIMEIRA FEZ QUE ESTOU CRIANDO UM TOPIC NO FORUM…
GOSTARIA DE SABER COMO EU FAÇO PARA RESOLVER O PROBLEMA DE ACESSO REGRESSIVO COM O FIREBIRD, POIS NÃO ESTOU CONSEGUINDO “VOLTAR REGISTROS”.
tenho um objeto ResultSet rs
e acesso os métodos rs.next(), rs.last(), rs.first() numa boa, mas não consigo acessar o rs.previous().
----Acho que não está implementado ou algo desse tipo. Segue o erro abaixo:
org.firebirdsql.jdbc.FBDriverNotCapableException: Result set is TYPE_FORWARD_ONLY
at org.firebirdsql.jdbc.FBCachedFetcher.previous(FBCachedFetcher.java:157)
at org.firebirdsql.jdbc.FBResultSet.previous(FBResultSet.java:996)
at janelas.CadastroDeGrupo.jButtonRegistroAnteriorActionPerformed(CadastroDeGrupo.java:192)
at janelas.CadastroDeGrupo.access$100(CadastroDeGrupo.java:13)
at janelas.CadastroDeGrupo$2.actionPerformed(CadastroDeGrupo.java:85)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
at javax.swing.AbstractButton$ForwardActionEvents.actionRESULTADO antes: false
Passou do setEnabled: !rs.isFisrt()
Performed(AbstractButton.java:1817)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5134)
at java.awt.Component.processEvent(Component.java:4931)
at java.awt.Container.processEvent(Container.java:1566)
at java.awt.Component.dispatchEventImpl(Component.java:3639)
at java.awt.Container.dispatchEventImpl(Container.java:1623)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
at java.awt.Container.dispatchEventImpl(Container.java:1609)
at java.awt.Window.dispatchEventImpl(Window.java:1590)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
----SEGUE TAMBÉM UM POUCO DA DOCUMENTAÇÃO DO DRIVER:
previous
public boolean previous()
throws java.sql.SQLExceptionMoves the cursor to the previous row in this ResultSet object.
Note: Calling the method previous() is not the same as calling the method relative(-1) because it makes sense to callprevious() when there is no current row.
Specified by:
previous in interface java.sql.ResultSet
Returns:
true if the cursor is on a valid row; false if it is off the result set
Throws:
java.sql.SQLException - if a database access error occurs or the result set type is TYPE_FORWARD_ONLY
Since:
1.2
See Also:
What Is in the JDBC 2.0 API
—UM PEDAÇO DO CÓDIGO FONTE DA MINHA APLICAÇÃO
stmt = conexao.createStatement(;
java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,
java.sql.ResultSet.CONCUR_READ_ONLY )
GOSTARIA DE SABER COMO FAÇO PARA RESOLVER ISSO.
OBRIGADO
