C C4RTH4G3 New Member Apr 26, 2021 #1 I have a B4XTable and I have a NullPointerException when i try to initialise the SQL database with the B4XTable : B4X: Copy If File.Exists(File.DirApp & "/Database", "NxTx 0.1.db") Then B4XTable1.SQL1.InitializeSQLite(File.DirApp & "/Database", "NxTx 0.1.db", False) Else B4XTable1.SQL1.InitializeSQLite(File.DirApp & "/Database", "NxTx 0.1.db", True) End If B4X: Copy java.lang.NullPointerException at b4j.example.oxygen2._initialize(oxygen2.java:57) at b4j.example.memberview._initialize(memberview.java:89) at b4j.example.searchview._result_listview_selectedindexchanged(searchview.java:112) 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$1.run(BA.java:216) 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:187) at java.lang.Thread.run(Thread.java:748) Is there anyway to use the B4XTable1.SQL1.InitializeSQLite function ? Appreciate any advice anyone can give.
I have a B4XTable and I have a NullPointerException when i try to initialise the SQL database with the B4XTable : B4X: Copy If File.Exists(File.DirApp & "/Database", "NxTx 0.1.db") Then B4XTable1.SQL1.InitializeSQLite(File.DirApp & "/Database", "NxTx 0.1.db", False) Else B4XTable1.SQL1.InitializeSQLite(File.DirApp & "/Database", "NxTx 0.1.db", True) End If B4X: Copy java.lang.NullPointerException at b4j.example.oxygen2._initialize(oxygen2.java:57) at b4j.example.memberview._initialize(memberview.java:89) at b4j.example.searchview._result_listview_selectedindexchanged(searchview.java:112) 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$1.run(BA.java:216) 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:187) at java.lang.Thread.run(Thread.java:748) Is there anyway to use the B4XTable1.SQL1.InitializeSQLite function ? Appreciate any advice anyone can give.
Erel B4X founder Staff member Licensed User Longtime User Apr 26, 2021 #2 Code is completely wrong. You should use B4XTable.SetData to set the data. It is up to you to read it from wherever you like into a List of arrays of objects. Upvote 0
Code is completely wrong. You should use B4XTable.SetData to set the data. It is up to you to read it from wherever you like into a List of arrays of objects.