Hi,
I read out pages of a ResultSet like this:
ScrollableResults sr = Interessent.getScrollableRS();
try {
sr.beforeFirst();
System.out.println("rownumber: "+sr.getRowNumber());
sr.setRowNumber(offset);
System.out.println("rownumber: "+sr.getRowNumber());
for (int i = 0; i < pageSize; i++){
Object[] inhalt = sr.get();
System.out.println("inhalt: "+inhalt[0]+" "+inhalt[1]+" "+inhalt[2]+" "+inhalt[3]+" "+inhalt[4]+" "+inhalt[5]+" "+inhalt[6]+" "+inhalt[7]);
int k = 0;
ergebnisListe.add(new SuchErgebnisInteressenten((String) inhalt[k++], (String) inhalt[k++], (String) inhalt[k++], (Calendar) inhalt[k++], (String) inhalt[k++], (String) inhalt[k++], (String) inhalt[k++], (String) inhalt[k++]));
sr.next();
}
sr.close();
If I want to get the second page out of the ResultSet I get the following error message:
ERROR [WorkerThread] (CommandDispatcher.java:373) - java.lang.NullPointerException
at com.mckoi.database.jdbc.MResultSet.columnCount(MResultSet.java:410)
at com.mckoi.database.jdbc.MResultSet.realIndexUpdate(MResultSet.java:614)
at com.mckoi.database.jdbc.MResultSet.absolute(MResultSet.java:1261)
at net.sf.hibernate.impl.ScrollableResultsImpl.setRowNumber(ScrollableResultsImpl.java:380)
at de.sv.kevus.controller.InteressentController.leseNaechsteSeite(InteressentController.java:238)
at de.sv.kevus.controller.CommandDispatcher.leseNaechsteSeite(CommandDispatcher.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at de.sv.kevus.controller.CommandDispatcher.executeCommand(CommandDispatcher.java:332)
at de.sv.kevus.client.connection.LocalBackendConnector$1.execute(LocalBackendConnector.java:92)
at de.sv.kevus.base.util.ObjectResultRunnable.run(ObjectResultRunnable.java:47)
at de.sv.kevus.base.util.WorkerThread.run(WorkerThread.java:60)
- StackTrace = java.lang.NullPointerException at com.mckoi.database.jdbc.MResultSet.columnCount(MResultSet.java:410) at com.mckoi.database.jdbc.MResultSet.realIndexUpdate(MResultSet.java:614) at com.mckoi.database.jdbc.MResultSet.absolute(MResultSet.java:1261) at net.sf.hibernate.impl.ScrollableResultsImpl.setRowNumber(ScrollableResultsImpl.java:380) at de.sv.kevus.controller.InteressentController.leseNaechsteSeite(InteressentController.java:238) at de.sv.kevus.controller.CommandDispatcher.leseNaechsteSeite(CommandDispatcher.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at de.sv.kevus.controller.CommandDispatcher.executeCommand(CommandDispatcher.java:332) at de.sv.kevus.client.connection.LocalBackendConnector$1.execute(LocalBackendConnector.java:92) at de.sv.kevus.base.util.ObjectResultRunnable.run(ObjectResultRunnable.java:47) at de.sv.kevus.base.util.WorkerThread.run(WorkerThread.java:60)
Why?
|