Hello everyone.
One database server has SQL Server 2008 R2 and another one is going to install SQL Server 2017.
I am using the Jrdc2 server with the jtds1.3.1 driver, but since it is not updated since 2013-06-08.
I am testing with the Microsoft driver mssql-jdbc-6.4.0.jre8.jar and also with mssql-jdbc-6.4.0.jre9.jar.
On the JRDC2 server I have an UPDATE command that can update an image field which can accept NULL values.
In the B4A application the images are saved in SQLite and then sent to the server, but in the Jrdc2 server:
When I use the #AdditionalJar: Jtds-1.3.1:
If I send a BLOB value it updates it well
If I send a NULL value it updates it OK.
When I use the #AdditionalJar: mssql-jdbc-6.4.0.jre8.jar or the #AdditionalJar: mssql-jdbc-6.4.0.jre9.jar:
If I send a BLOB value it updates it well.
If I send a NULL value, it generates an error:
(SQLServerException) com.microsoft.sqlserver.jdbc.SQLServerException: Conflict of operand types: nvarchar is incompatible with image
B4A:
B4J, config.properties:
What could I be doing wrong or is it a bug in JRDC2 or in Microsoft's Jdbc Driver?
Thank you.
One database server has SQL Server 2008 R2 and another one is going to install SQL Server 2017.
I am using the Jrdc2 server with the jtds1.3.1 driver, but since it is not updated since 2013-06-08.
I am testing with the Microsoft driver mssql-jdbc-6.4.0.jre8.jar and also with mssql-jdbc-6.4.0.jre9.jar.
On the JRDC2 server I have an UPDATE command that can update an image field which can accept NULL values.
In the B4A application the images are saved in SQLite and then sent to the server, but in the Jrdc2 server:
When I use the #AdditionalJar: Jtds-1.3.1:
If I send a BLOB value it updates it well
If I send a NULL value it updates it OK.
When I use the #AdditionalJar: mssql-jdbc-6.4.0.jre8.jar or the #AdditionalJar: mssql-jdbc-6.4.0.jre9.jar:
If I send a BLOB value it updates it well.
If I send a NULL value, it generates an error:
(SQLServerException) com.microsoft.sqlserver.jdbc.SQLServerException: Conflict of operand types: nvarchar is incompatible with image
B4A:
B4X:
Sub CreateCommand(Name As String, Parameters() As Object) As DBCommand
'
Dim cmd As DBCommand
cmd.Initialize
cmd.Name = Name
If Parameters <> Null Then cmd.Parameters = Parameters
Return cmd
'
End Sub
For Fil = 0 To MiCursor.RowCount -1
'
MiCursor.Position = Fil
Dim cmd As DBCommand
cmd = CreateCommand("update_e_3", Array As Object(MiCursor.GetBlob("IMAGE_X "), MiCursor.GetString("ID_X")))
DatosX.Add(cmd)
'
Next'
MiCursor.Close
'
Dim req As DBRequestManager
req.Initialize(Me,rdclink)
Dim Job As HttpJob = req.ExecuteBatch(DatosX,Null)
Wait For (Job) JobDone(Job As HttpJob)
ProgressDialogHide
If Job.Success Then
Msgbox("UPDATE OK", "MENSAJE")
Else
Msgbox(Job.ErrorMessage, "ERROR")
End If
Job.Release
B4J, config.properties:
B4X:
sql.update_e_3=UPDATE [TABLA-X] SET X_IMAGE = ? WHERE X_ID = ?;
What could I be doing wrong or is it a bug in JRDC2 or in Microsoft's Jdbc Driver?
Thank you.