cancel
Showing results for 
Search instead for 
Did you mean: 

jdbc

Akhil_Sun
Participant
0 Kudos

can anyone tell wht is stored procedure in jdbc plzzzzzzzz urgent.

Accepted Solutions (1)

Accepted Solutions (1)

aashish_sinha
Active Contributor
0 Kudos

HI,

A stored procedure is a subroutine available to applications accessing a relational database system. Stored procedures (sometimes called a sproc or SP) are actually stored in the database data dictionary.

Typical uses for stored procedures include data validation (integrated into the database) or access control mechanisms. Furthermore, stored procedures are used to consolidate and centralize logic that was originally implemented in applications. Large or complex processing that might require the execution of several SQL statements is moved into stored procedures and all applications call the procedures only.

Stored procedures are similar to user-defined functions (UDFs). The major difference is that UDFs can be used like any other expression within SQL statements, whereas stored procedures must be invoked using the CALL statement

Stored procedures can return result sets, i.e. the results of a SELECT statement. Such result sets can be processed using cursors by other stored procedures by associating a result set locator, or by applications. Stored procedures may also contain declared variables for processing data and cursors that allow it to loop through multiple rows in a table. The standard Structured Query Language provides IF, WHILE, LOOP, REPEAT, CASE statements, and more. Stored procedures can receive variables, return results or modify variables and return them, depending on how and where the variable is declared.

PLease refer this link

http://help.sap.com/saphelp_nw04/helpdata/en/1d/756b3c0d592c7fe10000000a11405a/content.htm

Regards

Aashish Sinha

PS : reward points if helpful

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi

Refer to my answer here

A stored procedure is a subroutine available to applications accessing a relational database system. Stored procedures (sometimes called a sproc or SP) are actually stored in the database.

Stored procedures are similar to user-defined functions (UDFs).

A stored procedure is a group of SQL statements that form a logical unit and perform a particular task, and they are used to encapsulate a set of operations or queries to execute on a database server

Use this

http://www.ics.com/support/docs/dx/1.5/tut6.html

http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html

http://www.sqlteam.com/article/stored-procedures-an-overview

Thanks

Former Member
0 Kudos

Take a look to this walkthroug of jdbc using stored procedures.

[SAP Network Blog: SYNCHRONOUS SOAP TO JDBC - END TO END WALKTHROUGH|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=luis+melgar&cat=sdn_all]

Former Member
0 Kudos

Hi,

Stored Procedure is the set of statements exceute simultaniosly. It is related to Oracle.

You can Call Stored Procedures in Java or You send data to Stored Procedure using Java. For you want write code in java

you need JDBC API. find the syntax for this.

The following code puts the SQL statement into a string and assigns it to the variable createProcedure, which we will use later:

String createProcedure = "create procedure

SHOW_SUPPLIERS " +

"as " +

"select SUPPLIERS.SUP_NAME, COFFEES.COF_NAME " +

"from SUPPLIERS, COFFEES " +

"where SUPPLIERS.SUP_ID = COFFEES.SUP_ID " +

"order by SUP_NAME";

Statement stmt = con.createStatement();

stmt.executeUpdate(createProcedure);

CallableStatement cs = con.prepareCall("{call SHOW_SUPPLIERS}");

ResultSet rs = cs.executeQuery();

Refer this below link

http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html

If you want to call a Stored procedure in Java

Former Member
0 Kudos

HI

refer the below links

http://help.sap.com/saphelp_nw04s/helpdata/en/b0/676b3c255b1475e10000000a114084/frameset.htm

http://help.sap.com/saphelp_nw04s/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/frameset.htm

/people/laxman.molugu/blog/2006/08/13/integration-with-databases-made-easy-150-part-1

/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures

http://help.sap.com/saphelp_nw04/helpdata/en/45/023c41325fa831e10000000a1550b0/frameset.htm

/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi

http://help.sap.com/saphelp_nw04/helpdata/en/1d/756b3c0d592c7fe10000000a11405a/content.htm

cheers

Former Member
0 Kudos

Hi,

A stored procedure is a subroutine available to applications accessing a RDBMS.

Usually stored procedure means several SQL statements that is under stored procedures and all applications call the procedures only. Multiple SQL statements are written in stored procedure and it can be called by single name rather than executing each statement separately.

why we use?

One of the usage is to prevent the query to directly write to the dateabase

http://en.wikipedia.org/wiki/Stored_procedure

Check these:

http://help.sap.com/saphelp_nw04s/helpdata/en/b0/676b3c255b1475e10000000a114084/frameset.htm

http://help.sap.com/saphelp_nw04s/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/frameset.htm

/people/laxman.molugu/blog/2006/08/13/integration-with-databases-made-easy-150-part-1

/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures

http://help.sap.com/saphelp_nw04/helpdata/en/45/023c41325fa831e10000000a1550b0/frameset.htm

/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi

Thanks,

Vijaya

Former Member
0 Kudos

Hi,

Check this

/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures

Calling stored procs in MaxDb using SAP Xi

/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi

Regards

Seshagiri

Edited by: N V Seshagiri on Jun 16, 2008 2:19 PM

Former Member
0 Kudos

Hi,

please have a look here:

/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures

Regards

Patrick