Greetings, been banging my head against the wall on this one. I'm using jRDC2 with B4J for my android, when I run my SELECT statement it works
But when I try my INSERT
The error I get in the log is
ResponseError. Reason: Server Error, Response:
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 org.eclipse.jetty.io.EofException: Closed</title>
</head>
<body><h2>HTTP ERROR 500 org.eclipse.jetty.io.EofException: Closed</h2>
<table>
<tr><th>URI:</th><td>/rdc</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>org.eclipse.jetty.io.EofException: Closed</td></tr>
<tr><th>SERVLET:</th><td>anywheresoftware.b4j.object.JServlet-50378a4</td></tr>
</table>
<hr/><a href="https://eclipse.org/jetty">Powered by Jetty:// 11.0.9</a><hr/>
</body>
(I took out the HTML tags, wasnt sure it would affect the post)
my config.properties SQL commands are
sql.get_one_user = SELECT full_name FROM UserTable WHERE count = ?;
sql.add_user = INSERT INTO UserTable (full_name) VALUES (?);
I'd appreciate any suggestions. Thanks.
SELECT:
Sub get_user (count As Int)
Dim req As DBRequestManager = CreateRequest
Dim cmd As DBCommand = CreateCommand("get_one_user", Array(count))
Wait For (req.ExecuteQuery(cmd, 0, Null)) JobDone(j As HttpJob)
If j.Success Then
req.HandleJobAsync(j, "req")
Wait For (req) req_Result(res As DBResult)
'work with result
req.PrintTable(res)
Else
Log("ERROR: " & j.ErrorMessage)
End If
j.Release
End Sub
But when I try my INSERT
INSERT fails:
Sub add_user(fullname As String)
Dim cmd As DBCommand = CreateCommand("add_user", Array(fullname))
Dim j As HttpJob = CreateRequest.ExecuteBatch(Array(cmd), Null)
Wait For(j) JobDone(j As HttpJob)
If j.Success Then
Log("Inserted successfully!")
End If
j.Release
End Sub
The error I get in the log is
ResponseError. Reason: Server Error, Response:
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 org.eclipse.jetty.io.EofException: Closed</title>
</head>
<body><h2>HTTP ERROR 500 org.eclipse.jetty.io.EofException: Closed</h2>
<table>
<tr><th>URI:</th><td>/rdc</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>org.eclipse.jetty.io.EofException: Closed</td></tr>
<tr><th>SERVLET:</th><td>anywheresoftware.b4j.object.JServlet-50378a4</td></tr>
</table>
<hr/><a href="https://eclipse.org/jetty">Powered by Jetty:// 11.0.9</a><hr/>
</body>
(I took out the HTML tags, wasnt sure it would affect the post)
my config.properties SQL commands are
sql.get_one_user = SELECT full_name FROM UserTable WHERE count = ?;
sql.add_user = INSERT INTO UserTable (full_name) VALUES (?);
I'd appreciate any suggestions. Thanks.