I am attempting to create a list from a SQL query:
The SQLite query using DBUtils is:
This works with a SQLite DB.
Using the SQL query above, I get the following error:
B4X:
Dim table As List = PushDB.ExecQuery2("SELECT push_messages.msg_id, text FROM push_messages, push_messages_to_deliver WHERE push_messages.msg_id = push_messages_to_deliver.msg_id AND user_id = ?", Array As String(id)) <<<<<-- (Error evaluating expression.)
If table.Size > 0 Then
Dim msgs As List
msgs.Initialize
For Each row() As String In table
msgs.Add(row(0))
msgs.Add(row(1))
Next
CallSubDelayed2(pb, "SendMessages", msgs)
End If
The SQLite query using DBUtils is:
B4X:
Dim table As List = DBUtils.ExecuteMemoryTable(PushDB, "SELECT push_messages.msg_id, text FROM push_messages, push_messages_to_deliver WHERE push_messages.msg_id = push_messages_to_deliver.msg_id AND user_id = ?", Array As String(id), 0)
Using the SQL query above, I get the following error:
B4X:
Waiting for debugger to connect...
Program started.
2017-02-28 11:06:58.502:INFO::main: Logging initialized @1138ms
2017-02-28 11:06:58.629:INFO:oejs.Server:main: jetty-9.3.z-SNAPSHOT
2017-02-28 11:06:58.701:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@4cf777e8{/,file:///C:/B4J-Server-Push/ServerExampleNoMySQL/Objects/www/,AVAILABLE}
2017-02-28 11:06:58.703:INFO:oejs.AbstractNCSARequestLog:main: Opened C:\B4J-Server-Push\ServerExampleNoMySQL\Objects\logs\b4j-2017_02_28.request.log
2017-02-28 11:06:58.836:INFO:oejs.ServerConnector:main: Started ServerConnector@49fc609f{HTTP/1.1,[http/1.1]}{0.0.0.0:32009}
2017-02-28 11:06:58.837:INFO:oejs.Server:main: Started @1474ms
Emulated network latency: 200ms
Server started
NewConnection: 358726061334668
MyCount: 1
java.lang.NullPointerException
at anywheresoftware.b4j.object.WebSocketModule$Adapter.onWebSocketText(WebSocketModule.java:121)
at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextMessage(JettyListenerEventDriver.java:189)
at org.eclipse.jetty.websocket.common.message.SimpleTextMessage.messageComplete(SimpleTextMessage.java:69)
at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:66)
at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextFrame(JettyListenerEventDriver.java:158)
at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:162)
at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:367)
at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:214)
at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220)
at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:256)
at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:663)
at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:493)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.execute(ExecuteProduceConsume.java:101)
at org.eclipse.jetty.io.ManagedSelector.run(ManagedSelector.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
at java.lang.Thread.run(Thread.java:745)