Would anyone suggest a solution to the following problem?
I'm trying to call a stored procedure in MySQL 5 from WO 5.3 using executeStoredProcedureNamed via mysql-connector-java-3.1.8bin.jar . The sproc is a cursor that takes no arguments and returns none. In MySQL I simply call it like this: 'call ItemsCursor()' and that does the trick. When I call it from WO I get an error and it looks like its calling it this way: 'call ItemsCursor' which seems to be missing the critical '()'. I have no idea on how to get this in place nor why WO doesn't automatically do that. Maybe there is another reason for this issue. I tried it with null and with a Dictionary as shown below.
This is the code I use to try to call the sproc: public WOComponent pushTran() { try { NSMutableDictionary param = new NSMutableDictionary(); EOUtilities.executeStoredProcedureNamed( session().defaultEditingContext(), "itemscursor", param ); } catch (Exception e) { // could be more specific... NSLog.err.appendln( "Issue pushing transactions: " + e.toString() ); } return null; }
This is the Error that returns:
13105 [main] WARN NSLog - 34709 [WorkerThread0] INFO er.transaction.adaptor.Exceptions - JDBC Exception occured: com.webobjects.jdbcadaptor.JDBCAdaptorException: EvaluateExpression failed: <com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "{ call ItemsCursor}">: Next exception:SQL State:42000 -- error code: 1064 -- msg: 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 '' at line 1 34712 [WorkerThread0] WARN NSLog - Issue pushing transactions: com.webobjects.jdbcadaptor.JDBCAdaptorException: EvaluateExpression failed: <com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "{ call ItemsCursor}">: Next exception:SQL State:42000 -- error code: 1064 -- msg: 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 '' at line 1
Thanks, --Mat |