Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Application and Web Development > Java

Reply
 
LinkBack Thread Tools Display Modes
Old 12-17-2006, 11:28 PM   #1 (permalink)
j.gohel
Code Monkey
 
Join Date: Apr 2005
Posts: 68
j.gohel is on a distinguished road
Various Techniques for calling stored procedures using java

Hello ,

Please help me understand the below technique of calling the Stored Procedure written in Oracle using java.In our application it is working fine but while surfing i found out that some people got exceptions using this technique and some of the experts recommended using the technique of
{call ... }

connection.prepareCall("begin XYZProc(?,?,?,?); end;");

Thanks in advance.
j.gohel is offline   Reply With Quote
Old 12-18-2006, 03:54 AM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,175
Belisarius is on a distinguished road
Honestly, I've only used prepared statements - I haven't used stored procedures before.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 12-19-2006, 12:56 PM   #3 (permalink)
technobard
Centurion Nova Prime
 
technobard's Avatar
 
Join Date: May 2002
Location: Oak Park, IL (USA)
Posts: 287
technobard is on a distinguished road
Quote:
Originally Posted by j.gohel View Post
some of the experts recommended using the technique of
{call ... }
Hmmmm... I've used {call....} before. I didn't know the other existed until now, but it makes sense. prepareCall is intended to be used if you want to call the same stored procedure multiple times with different parameters. The question marks (?) are placeholders, the same as when you use a prepareStatement. "Call" is intended for a single execution. There is nothing to stop you from using "Call" multiple times. The advantage of "prepare" anything is that bind variables are used. This eliminates the need to parse the statement at the database level every time you execute it. This is important for scalability for applications supporting a lot of users.
__________________
It takes 2 points to draw a straight line, but at least 3 points to draw a conclusion.
technobard is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the best way to test T-SQL stored procedures? woojtii Everything SQL ( MySQL, MSSQL, DB2, Postgre, Oracle, etc...) 0 11-07-2006 04:15 AM
Java Resources Belisarius Java 0 03-28-2005 03:03 PM
Java Developer Position in Kansas City justplaindoug Java 0 10-29-2004 12:52 PM


All times are GMT -8. The time now is 12:41 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting