JSP call of Stored Procedure Problems

Source: Internet
Author: User
Topic: Question about calling the stored procedure in JSP!
Last time: total replies: 14 pages: 1

[Reply to subject]

JSP call stored procedure problems!
Author:Y970105Short Message
AM Reply
I want to call a stored procedure on the page

Only show the day's inner

@ Time = getdate ()

But no.

I am using the dreamwwar development tool.

Why does my stored procedure not exist?

Reply: Question about calling the stored procedure in JSP!
Author:WtigterShort Message
Reply topic: Question about calling the stored procedure in JSP!


Reply 1 of 14
Reply
Use Bean to call the stored procedure, and then call bean in jsp

You can reference <java Database Programming Guide>

Reply: Question about calling the stored procedure in JSP!
Author:AsiazhaoShort Message
Reply topic: Question about calling the stored procedure in JSP!


Reply 2 of 14
Reply
Different database statements

Reply: Question about calling the stored procedure in JSP!
Author:Ilovesea2003Short Message
Reply topic: Question about calling the stored procedure in JSP!


Reply 3 of 14
Reply
<%

String strSql = "{call sys_p_wf_state (" + String. valueOf (iTaskType) + ", '" + userID + "','',?)} ";
ResultSet rs = null;
Rs = TaxFlowWeb. getInstance (). getResultSet (strSql ,"");

%>

Reply: Question about calling the stored procedure in JSP!
Author:VchenShort Message
Reply topic: Question about calling the stored procedure in JSP!


Reply 4 of 14
Reply
You can refer to the oracle demo, which is very detailed.
Method:
After installing ORACLE, there will be a folder named ORA90 to find the JAVA file, and the code can be run directly.

Reply: Question about calling the stored procedure in JSP!
Author:AxmanShort Message
Reply topic: reply: Question about calling the stored procedure in JSP!


Reply 5 of 14
Reply
<%

String strSql = "{call sys_p_wf_state (" + String. valueOf (iTaskType) + ", '" + userID + "','',?)} ";
ResultSet rs = null;
Rs = TaxFlowWeb. getInstance (). getResultSet (strSql ,"");

%>
Is this something written by humans? You are not suitable for program writing. In fact, it may lead to more development if you want to change the line. Why do you have to do what you cannot do?

Reply: Question about calling the stored procedure in JSP!
Author:RonanljyShort Message
Reply topic: reply: Question about calling the stored procedure in JSP!


Reply 6 of 14
Reply
Yes, there is a special content in JAVA database programming.

My previous practice was to call stored procedures in the background, and write the called procedures into a special public class, as long as the set and get parameters are enough. Do not write SQL statements.

Reply: Question about calling the stored procedure in JSP!
Author:Java_zhangyuShort Message
Reply topic: Question about calling the stored procedure in JSP!
PM

Reply 7 of 14
Reply
Simple:
<% // QQ273539152
/* Stored procedure:
Create or replace procedure proce_test (
A in varchar2,
B in varchar2,
C out varchar2
)
Begin
C: = a | B;
End proce_test;
/
*/
// The stored procedure has two inputs and one output parameter.
Class. forName ("oracle. jdbc. driver. OracleDriver"). newInstance ();
Connection conn = drivermanager. getconnection (databaseurl, databaseuser, databasepassword );
Callablestatement CMT = conn. preparecall ("{call pr_00_jiesuan (?,?,?) }");
CMT. setstring (1, "hello"); // Input
CMT. setstring (2, "World! "); // Enter
CMT. registeroutparameter (3, types. varchar); // register the output parameter
Resultset rs = cmt.exe cutequery ();
String STR = CMT. getstring (3); // obtain the output value
Rs. Close ();
CMT. Close ();
Conn. Close ();
%>

Reply: Question about calling the stored procedure in JSP!
Author:NealspShort Message
Reply topic: Question about calling the stored procedure in JSP!
PM

Reply 8 of 14
Reply
Can anyone tell me what is the use of stored procedures?

In what scenarios?

I'm a cainiao. Never give me a rock! Pai_^

Reply: Question about calling the stored procedure in JSP!
Author:Java_zhangyuShort Message
Reply topic: reply: Question about calling the stored procedure in JSP!


Reply 9 of 14
Reply
The combined use of stored procedures and external programs can speed up operation and express delivery and reduce system consumption. stored procedures can directly perform operations, sorting, filtering, and other work on data in the database, and then output data through output parameters, reduces the number of JDBC accesses.

Reply: Question about calling the stored procedure in JSP!
Author:Mxp2002Short Message
Reply topic: reply: Question about calling the stored procedure in JSP!


Reply 10 of 14
Reply
Q: What do you usually write about your stored procedures? Is writing highly efficient?
Haha, this question makes you laugh :)

Reply: Question about calling the stored procedure in JSP!
Author:Java_zhangyuShort Message
Reply topic: reply: Question about calling the stored procedure in JSP!


Reply 11 of 14
Reply
The stored procedure is from an Oracle database and from SQL-server, but MySQL does not.

Reply: Question about calling the stored procedure in JSP!
Author:Spark998Short Message
Reply topic: reply: Question about calling the stored procedure in JSP!
PM

Reply 12 of 14
Reply
PP

Reply: Question about calling the stored procedure in JSP!
Author:Java_zhangyuShort Message
Reply topic: reply: Question about calling the stored procedure in JSP!


Reply 13 of 14
Reply
However, the latest MySQL also has a stored procedure, which is weak.

Reply: Question about calling the stored procedure in JSP!
Author:NealspShort Message
Reply topic: reply: Question about calling the stored procedure in JSP!


Reply 14 of 14
Reply
The stored procedure should be something in the database. Where should I write it? In the database?

How to write the stored procedure? Since an external program, such as java, calls the stored procedure, it also requires an interface,
Is this database interface?

Do I need to pass parameters when calling a stored procedure? How to Establish the passed parameters? Can I flexibly change output parameters?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.