cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to establish the connection

Highlighted
Frequent Contributor

Not able to establish the connection

Hi Ole,
           I was trying to update my data table using JDBC option in DATA SINK but i am getting an as no suitable driver is found .. I have also attached a screen shot along with my post kindly go through it
12 REPLIES 12
Highlighted
Super Contributor

Re: Not able to establish the connection

Hi Anand,

have you put the mysql-driver in the soapui\bin\ext folder? Is it being loaded by soapUI at startup? (check the soapui log tab)

regards,

/Ole
eviware.com
Highlighted
Frequent Contributor

Re: Not able to establish the connection

Hi Ole,
      Yes I have loaded the jar in the specified folder why I escalated this problem because I am able to store the data in MYSQL without any problem using JDBC driver . But if i use the same connection string in Data Sink i came across this problem . I have used the following strings in my test

Driver  :"com.mysql.jdbc.Driver"
Connection string which i used :sql = Sql.newInstance("jdbc:mysql://localhost:3306/anand", "root", "evipass",
Highlighted
Super Contributor

Re: Not able to establish the connection

Hi Anand,

I'm sorry, I didn't look at your screenshoot good enough.. you seem to have specified a groovy-script in the connection-string field, instead you should "just" specify the connection string, try using

jdbc:mysql://localhost:3306/anand?user=root&password=evipass

regards,

/Ole
eviware.com
Highlighted
Frequent Contributor

Re: Not able to establish the connection

Ho Ole,
Thanks a lot it working well but i got an error while trying upddate my database my query was

UPDATE DATA SET
X= 2,
Y=3,
WHERE RESULT=24;
It has thrown an error...

java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).

Any idea about this ... where i went wrong I am wrong in the update query
Highlighted
Frequent Contributor

Re: Not able to establish the connection

Hi Ole,
          Waiting for your reply
Highlighted
Super Contributor

Re: Not able to establish the connection

Hi,

yes; every property in the DataSink is set as a parameter in the update, and since you don't have any (specified with a '?' in the SQL), you are getting this. Either remove the result property or add a parameter to your SQL statement!

hope this helps!

regards,

/Ole
eviware.com
Highlighted
Frequent Contributor

Re: Not able to establish the connection

Hi Ole,
          I have tried what you said but got an erro like

com.mysql.jdbc.exceptions.MySQLSyntaxErrorException:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
'WHERE "RESULT"=24' at line 4

the update syntax which i used is
UPDATE DATA SET
X= 2,
Y=3,
WHERE "RESULT"=24;

Can you tell m where did i went wrong
Highlighted
Super Contributor

Re: Not able to establish the connection

Hi Anand,

could you show a screenshot of the jdbc-datasink window so I can see the "whole picture"? Thanks in advance!

/Ole
eviware.com
Highlighted
Frequent Contributor

Re: Not able to establish the connection

Hi Ole,
            PFA

              I have attached the screen shot of the data sink .

Thanks a lot
New Here?
Join us and watch the welcome video:
Top Kudoed Authors