Quantcast
Channel: MySQL Forums - Connector/J, JDBC and Java
Viewing all articles
Browse latest Browse all 884

JDBC "call proc" fails where command line works (1 reply)

$
0
0
I am getting the error "procedure XXX can't return a result set in the given context" when calling a stored proc with Connector/J 5.1.18. The stored proc in question has one cursor, but no bare SELECT statements in it.

I can call the proc from the mysql command line client and it works as expected - the MySQL client and server are both version 5.1.47.

My Java code is:

CallableStatement s = connection.prepareCall("{call YYY(?, ?)}");
s.setString(1, "foo");
s.setString(2, "bar");
s.execute();

Proc YYY then calls proc XXX, and the execute() throws a SQLException with a 1312 error code.

Is there a MySQL session parameter or something I should be setting on the JDBC connection that would make it work like the mysql client?

Thanks,
Greg.

Viewing all articles
Browse latest Browse all 884

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>