Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003
    Location
    London
    Posts
    2

    Question Unanswered: Unsupported Data Conversion using Microsoft SQL Server JDBC Driver.

    Hi, I am receiving errors on using a ejbCreate() method. My application server is Jrun 3.1 and my database is Microsoft SQl Server 2000
    My error occurs in my container managed EJB because I am trying to return the primary key value for my new record inserted.

    If I do not try to retrieve this value from my insert, my insert works fine.

    I am using Microsoft SQL Server JDBC Driver. Before this I was using a JDBC-ODBC bridge and the error did not occur but since I moved to my SQL Server driver my error results.

    My Stored Procedure called is as follows:

    CREATE PROCEDURE spr_ins_ContactEvent
    @cSession int,
    @aSession int,
    @interactiveItemKey int,
    @accountKey int,
    @treatKey int,
    @methodOfContact char(6),
    @promoCode char(6),
    @direction char(1),
    @contactDate datetime,
    @contactEventKey int OUTPUT
    AS
    BEGIN
    INSERT INTO contactEvent(cSession, aSession, interactiveItemKey, accountKey, treatKey, methodOfContact, promoCode, direction, contactDate)
    VALUES (@cSession, @aSession, @interactiveItemKey, @accountKey, @treatKey, @methodOfContact, @promoCode, @direction, getDate())
    SELECT @contactEventKey = MAX(contactEventKey) FROM contactEvent
    END
    GO

    My XML insert method is as follows:

    <env-entry>
    <env-entry-name>ejipt.createSQL</env-entry-name>
    <env-entry-value>{call spr_ins_ContactEvent (?,?,?,?,?,?,?,?,?,?)}</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>ejipt.createSQL.source</env-entry-name>
    <env-entry-value>myjdbc</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>ejipt.createSQL.params</env-entry-name>
    <env-entry-value>cSession,aSession,interactiveItemKey,account Key,treatKey,methodOfContact,promoCode,direction,c ontactDate,contactEventKey UT</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>ejipt.createSQL.paramTypes</env-entry-name>
    <env-entry-value>INTEGER, INTEGER, INTEGER, INTEGER, INTEGER, CHAR, CHAR, CHAR, TIMESTAMP, INTEGER</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>ejipt.createSQL.fields</env-entry-name>
    <env-entry-value>contactEventKey</env-entry-value>
    </env-entry>


    Can anyone see where my problem lies, or do you know if Microsoft SQL Server JDBC drivers always cause this problem in returning a value from a create/insert method?

    Cheers in advance,

    Fergus

  2. #2
    Join Date
    Apr 2003
    Location
    London
    Posts
    2

    Re: Unsupported Data Conversion using Microsoft SQL Server JDBC Driver.

    Do you think I should move this to the Java section?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •