This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JDBC and the fly likes Result Set from a DB2 stored procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Result Set from a DB2 stored procedure" Watch "Result Set from a DB2 stored procedure" New topic

Result Set from a DB2 stored procedure

Richard Olmstead

Joined: Jun 12, 2006
Posts: 5
Hello colleagues,
My Java call to a DB2 stored procedure isn't working... the error is
String Literals not supported in procedure calls to DB2/390

and, the code is
String inp = "76021592220080101" ;
String sql = "{call ? := G714.GDDPOHP2(?)} " ;

CallableStatement callable = conn.prepareCall( sql );
callable.registerOutParameter(1, java.sql.Types.CHAR);
callable.setString(2, inp);

I'd be grateful for any advice.
It is sorta covered in the JavaRanch Style Guide.
subject: Result Set from a DB2 stored procedure
Similar Threads
Calling DB2 stored procedures
System exception on UserTransaction.commit() , followed by RollbackException
Oracle procedure works in direct SQL but not via Java
Calling Stored Procedure from Hibernate mapping file
Error while callling stored procedure : Non supported SQL92 token