I am using a resultset to load a B4XTable as suggested in the post "[B4X] B4XTable - Load data from SQL database".
OK, everything is working fine.
But my first attempt was:
which made sense to me, since SetData expects a list and ExecutList returns a list. However, this produces the error below.
Am I doing something wrong or does SetData not allow ExecutList as source?
OK, everything is working fine.
But my first attempt was:
B4X:
B4XTable1.AddColumn("Jogador", B4XTable1.COLUMN_TYPE_TEXT)
B4XTable1.SetData( DBUtils.ExecuteList(Main.Banco, "SELECT jogador FROM resultados", Null, 0) )
which made sense to me, since SetData expects a list and ExecutList returns a list. However, this produces the error below.
Am I doing something wrong or does SetData not allow ExecutList as source?
Waiting for debugger to connect...
Program started.
ExecuteMemoryTable: SELECT jogador FROM resultados
Error occurred on line: 677 (B4XTable)
java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.Object;
at b4j.example.b4xtable$ResumableSub_SetData.resume(b4xtable.java:463)
at b4j.example.b4xtable._setdata(b4xtable.java:225)
at b4j.example.teste._show(teste.java:51)
at b4j.example.main$ResumableSub_AppStart.resume(main.java:143)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:42)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:136)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:85)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:487)
at anywheresoftware.b4a.keywords.Common.access$0(Common.java:467)
at anywheresoftware.b4a.keywords.Common$CallSubDelayedHelper.run(Common.java:541)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:186)
at java.lang.Thread.run(Thread.java:748)