ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Ws Wiki] Update of "Tuscany/TuscanyJava/DAS Java Overview/RDBDAS Java User Guide/Stored Procedures" by KevinWilliams
Date Tue, 10 Oct 2006 20:54:17 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.

The following page has been changed by KevinWilliams:
http://wiki.apache.org/ws/Tuscany/TuscanyJava/DAS_Java_Overview/RDBDAS_Java_User_Guide/Stored_Procedures

------------------------------------------------------------------------------
- The DAS can work with stored procedures in much the same way it works with SQL statements.
 The follwing example shoud look familiar except a stored prcedure call replaces the typical
SELECT statement:
+ The DAS can work with stored procedures in the same way it works with SQL statements.  The
follwing example shoud look familiar except that a stored prcedure call statement replaces
the typical SELECT statement:
  
+ {{{
+    DAS das = DAS.FACTORY.createDAS(getConnection());
+    Command read = das.createCommand("{call GETALLCOMPANIES()}");
+    DataObject root = read.executeQuery();
+ }}}
+ 
+ The predefined stored procedure "GETALLCOMPANIES" returnes a result just like "select *
from company" would.  There are of course stored procedures that do not return result sets
and these call also be executed with the same programming model.  Any arbitrary stored procedure
can invoked in this way. The follwing example calls proc that deletes an identified company:
+ 
+ {{{
+    DAS das = DAS.FACTORY.createDAS(getConnection());
+    Command delete = das.createCommand("{call DELETECUSTOMER(?)}");
+    delete.setParameter(1, Integer.valueOf(1));
+    delete.execute();
+ }}}
+ 

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@ws.apache.org
For additional commands, e-mail: general-help@ws.apache.org


Mime
View raw message