I'm trying to execute a stored procedure like follows:
CallableStatement cs = this.con.prepareCall("{call getDeliveryConfirmations(?)}");
cs.setString(1, "545A6F33-A22A-47A6-AF97-0D952F2D80D7");
Resultset rs = cs.executeQuery();
As you can see I'm setting a Guid/UniqueIdentifier in the callable statement as a parameter before executing... But as you also can make out is that I use the method 'setString' on the callableStatement object and as a result I'm getting this error:
com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to uniqueidentifier.
I'd imagine that if there was a method like 'setGuid' or something for the callablestatement object that I won't have this problem... Anyone know of a workaround etc?
Edit:
Code for the stored procedure 'getDeliveryConfirmations'
USE [VodacomXml2Sms]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
BEGIN
SET NOCOUNT ON;
select * from OutgoingDeliveryConfirmations
where smsGuid = @selectedGuid
END