Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Kevin Jenkins   on Jun 24 In Java Category.

  
Question Answered By: Edfu Massri   on Jun 24

I am on the look out for a way to pass parameters  to a stored
procedure using their names as defined  in the stored  procedure.

java.sql.Statement 's .execute() should be called after the parameters
are set. But the problem  lies in the previous step. I'll elaborate --

As I mentioned in previous mail following command works in Query Analyser.
exec  update_costing_table @costing_code='4001' "

In java  I can achieve above result as under --
PreparedStatement pstmt =
connection.prepareStatement("call update_costing_table (?)");
pstmt.setString(1,"4001");
pstmt.executeUpdate();

But here parameter  is passed  using column Index not by column name.
And I precisely need to do it using column name only.

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Problem in calling stored procedure Or get search suggestion and latest updates.


Tagged: