Forum Discussion

TomK's avatar
TomK
Contributor
16 years ago

Datasink problems writing to MySQL or DB2

Hello,

I am trying to use datasink to write some data to either MySQL or DB2. I have tried all ways ie. Like prepared statements, hard coded. Nothing seems to work. The datasink fails (icon becomes red) no error message or exception is shown in the log or anywhere else, and nothing is written to the database.

I am using the Driver and connection string succesfully to read data from both databases mentioned above.

I saw a recent post on soapUI board and apparently it was solved in a newer version. I have soapUI pro 2.0.2.


Thanks,

Tom

---

Also is it possible to not have the default '?' question marks in the XML messages? They break the schema and for large messages it becomes to labour intensive removing those by hand.

4 Replies

  • TomK's avatar
    TomK
    Contributor
    I managed to write to a mysql database using jdbc in the setup script (both insert and update) using prepared statements but still no luck with datasink.

    With DB2 it's a little trickier. I can write to DB2 using hard coded values.

    If I use prepared statement and press the green arrow on the setup script - nothing happens, nothing get written to the DB. If I press the green arrow on the test the following exception is logged in soapUI log and test log:    java.lang.UnsatisfiedLinkError: COM.ibm.db2.jdbc.app.DB2PreparedStatement.SQLBindChar(IIJILjava/lang/String;IJ[JIIZ)I

    Hope that helps.

    Regards,

    Tom
  • TomK's avatar
    TomK
    Contributor
    Somehow I managed to make the datasink work.

    I was able to insert and update mySQL using prepared statements

    And was able to insert and update DB2 but had to use a different Connection String (which forces the use of a different driver). I used this version of the string: "jdbc:db2://server:port/database:user=xxx;password=xxx;"

    If the server and port are omitted then the CLI driver is used which throws the following exception when using a prepared statement:

    Wed Jun 25 16:22:42 BST 2008:ERROR:COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0124E  Invalid argument value. SQLSTATE=HY009

    So all is sorted really.

    Regards,

    Tom
  • TomK's avatar
    TomK
    Contributor
    Problems again.

    The Datasink to DB2 stopped working again.

    Methinks it's quite temperamental.

    T
  • TomK's avatar
    TomK
    Contributor
    The problem occurs when there are more properties than question marks in the statement. Then nothing happens.

    And if the record already exists in the database no warning is shown.

    T