MySQL Forums
Forum List  »  Stored Procedures

Re: Dynamic Sql Statement in SP
Posted by: Roland Bouman
Date: January 11, 2006 06:54AM

Ming Yeung wrote:
> Thanks for reminding me again, I think I will
> create a java function to check all IN-parameters

mm, I gueass I'd just use the earlier suggestion (? style parameters in the statement string, EXECUTE ... USING @p1,@p2 etc)

This way, it will still work when you backport your app to php again ;-)

Seriously, you should make as much effort as you can do to make the procedure self-contained. It should not matter from what context the procedure is called, and applications should not worry about how to escape parameter values. After all, it's the procedure's parameters so it's the procedure's problem. Well then, the procedure should solve it's own problem.

> My Environment:
> - Win 2003
> - mysql-5.0.16-win32
> - Tomcat 5.5.12
> - MyEclipse -> Struts/Servlet
> - J2EE 1.4 SDK & jre1.5.0_06
> - mysql-connector-java-3.1.12
> - Jakarta DBCP

Thanks! I will test for a bit with this DBCP bit (that's the connection pooling stuff right?)

> I'm actually so glad to see MySql's new
> baby(Stored Procedure). I understand I should use
> SP instead of just writting plain Sql statements
> in Java/Php,etc. I hope SP of MySql will get more
> more stable in the next versions...

Me too. SP's are very good for stuff thats shared between apps (code reuse). Also performance might be a consideration: a sequence of database tasks are probably executed more efficiently when this is done on only the serverside, without having the network overhead of sending commands and receiving results/acknowledgements.

CU, good luck

Options: ReplyQuote


Subject
Views
Written By
Posted
2920
January 09, 2006 06:22AM
1581
January 09, 2006 08:06AM
1309
January 09, 2006 02:10PM
1888
January 09, 2006 08:02PM
1764
January 10, 2006 12:24AM
1579
January 10, 2006 03:07AM
1783
January 10, 2006 06:51AM
1489
January 10, 2006 01:49PM
1838
January 10, 2006 06:35PM
1638
January 10, 2006 07:22PM
1723
January 10, 2006 10:33PM
1734
January 11, 2006 03:10AM
2288
January 11, 2006 04:27AM
Re: Dynamic Sql Statement in SP
1724
January 11, 2006 06:54AM
1578
January 11, 2006 03:34PM
1751
January 11, 2006 03:56PM
1746
January 12, 2006 03:20AM
1532
January 12, 2006 04:44AM
1517
January 11, 2006 09:08PM
1752
January 12, 2006 03:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.