But when we run Insert, Update or Delete we get an error:
ResponseError. Reason: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0., Response: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /rdc. Reason:
<pre> org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>
</body>
</html>
** Activity (main) Pause, UserClosed = false **
By executing the Insert command directly on the database, no error occurs. Ex:
insert into pessoas values ('maria', 30)
- Postgresql version 11;
- B4A version 8.5;
- B4J version 6.8;
- Server (JRDC2 and Postgresql) Windows Server 2016.
P.S: Attachment file config with insert command that is running: sql.insert_people = INSERT INTO pessoas VALUES (?,?).
Sub InsertRecord (nome As String, idade As Int)
Dim cmd As DBCommand = CreateCommand("insert_pessoas", Array(nome, idade))
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
I installed and configured B4J on the server to check the log. I reinstalled Oracle JDK 8. After this process I was able to insert normally with the command below:
B4X:
sql.insert_pessoas=INSERT INTO pessoas VALUES(?, ?)