on 07-18-2007 10:53 AM
Hi,
I have 2 requests:
1. Could anyone tell me how I would define a stored procedure within the SAP Java database (I am using a JAVA-only WAS engine)? Do I need to use the appropriate vendor DB tools?
2. Could anyone provide an actual example of a Web Dynpro accessing a Stored Procedure?
Many thanks,
Brian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Brian,
Here is a code sample, before using it make sure you configure a JDBC connector on the Java AS with the alias defined in the code:
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup(<JDBC_CONNECTOR_ALIAS>);
Connection conn = ds.getConnection();
// in this case the SP got 2 parameters
CallableStatement cs = connection.prepareCall("{call <SP_NAME>(?,?)}");
cs.execute();
It's of course messy and without proper exception handling but you'll manage from here I beleive...
Hope it helps,
Roy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.