views:

219

answers:

1

I'm calling a stored procedure via ibatis. It works, and has worked, when using the jconn2.jar (5.5). When I swap it out for the jtds jar (1.2.5) I get an exception "Invalid SQL statement or JDBC escape, terminating '}' not found."

For more transparency I'm using Spring with DBCP. Obviously the parsing of the SQL code in jTDS is not being liked, that is being accepted in jconn2. This project predates a bunch of us, and I haven't used Sybase in years.

The outlying chars in the data are "-", ":" and "."

Do I need to escape my parameters in the stored procedure call statement to get around this issue? Are there default settings for jconn2 that are not set for jTDS?

Thanks.

A: 

The answer is jConnect loosely interprets the ordering of braces and parentheses.

So {call MyStoredProc(?,?,?}) is fine for jConnect. jTds has strict parsing, so the mis-matched brace and parenthesis is incorrect.

Not fun.

Spencer K