Django Helery Marques Member Licensed User Longtime User May 27, 2016 #1 what causes this error ? btnbuscar_click (java line: 430) Dim rs1 as ResultSet rs1 = mh1.Query("select cli.cli_codigo,cli.cli_descricao from cli cli") java.lang.ClassCastException: com.mysql.jdbc.JDBC4ResultSet at b4a.example.main._btnbuscar_click(main.java:430) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157) at anywheresoftware.b4a.BA.raiseEvent(BA.java:153) at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78) at android.view.View.performClick(View.java:2485) at android.view.View$PerformClick.run(View.java:9080) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3687) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625) at dalvik.system.NativeStart.main(Native Method) java.lang.ClassCastException: com.mysql.jdbc.JDBC4ResultSet
what causes this error ? btnbuscar_click (java line: 430) Dim rs1 as ResultSet rs1 = mh1.Query("select cli.cli_codigo,cli.cli_descricao from cli cli") java.lang.ClassCastException: com.mysql.jdbc.JDBC4ResultSet at b4a.example.main._btnbuscar_click(main.java:430) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157) at anywheresoftware.b4a.BA.raiseEvent(BA.java:153) at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78) at android.view.View.performClick(View.java:2485) at android.view.View$PerformClick.run(View.java:9080) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3687) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625) at dalvik.system.NativeStart.main(Native Method) java.lang.ClassCastException: com.mysql.jdbc.JDBC4ResultSet
DonManfred Expert Licensed User Longtime User May 27, 2016 #2 You need to post the full code. With this snippet it can not work so i guess you forgoet to post relevant code Upvote 0
You need to post the full code. With this snippet it can not work so i guess you forgoet to post relevant code
S sorex Expert Licensed User Longtime User May 27, 2016 #3 you have a double table name in your query. you also don't need to prefix the table name to the selected fields when you don't have joins. Upvote 0
you have a double table name in your query. you also don't need to prefix the table name to the selected fields when you don't have joins.
DonManfred Expert Licensed User Longtime User May 27, 2016 #4 "select cli.cli_codigo,cli.cli_descricao from cli as cli" will be the same. But it is not a good idea to use the same name as the table for an alias Upvote 0
"select cli.cli_codigo,cli.cli_descricao from cli as cli" will be the same. But it is not a good idea to use the same name as the table for an alias
apiwatcomscith Member Licensed User Longtime User May 28, 2016 #5 best way try to run query "select cli.cli_codigo,cli.cli_descricao from cli cli" in database manager for test you can get real error. i think so Upvote 0
best way try to run query "select cli.cli_codigo,cli.cli_descricao from cli cli" in database manager for test you can get real error. i think so