aspose file tools*
The moose likes JDBC and the fly likes JDBC and Stored Procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC and Stored Procedure" Watch "JDBC and Stored Procedure" New topic
Author

JDBC and Stored Procedure

Prithiraj Sen Gupta
Ranch Hand

Joined: Sep 13, 2006
Posts: 92
Hi,

May I know about the different ways in JDBC for retrieving data from the database without using Stored Procedure / 'PL/SQL'?

Thanks & Regards

Prithiraj Sen Gupta
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42908
    
  69
Umm, the SQL SELECT statement?
Jeff Ash
Greenhorn

Joined: Apr 07, 2007
Posts: 11
I'm not completely clear on your question, but are you referring to things that you can do in VB for example like simply specifying a table name instead of a complete SQL SELECT statement? If so, then no. JDBC requires that you actually execute SQL statements.

Hibernate (http://www.hibernate.org) is a framework that allows you do object/relational mapping from Java. It has a number of different ways that you can get data from the database.

Not sure if I understood your question right, but I hope this helps.


Jeff Ash<br /><a href="http://www.excellentiasoftware.com" target="_blank" rel="nofollow">Excellentia Software</a>
Suman Sharma
Ranch Hand

Joined: May 16, 2005
Posts: 72
Statement and PreparedStatement objects can be used to retrieve data from the database.
Prithiraj Sen Gupta
Ranch Hand

Joined: Sep 13, 2006
Posts: 92
I know that to retrive data from database one should write Stored Prcocedures. But there are some other ways to do it. Bear Bibeault, Moderator of Html and JavaScript, told me that he dont uses stored procedure. He adviced me to Post a topic here. The discussion between With Him can be found HERE.

Thanks & Regards

Prithiraj
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42908
    
  69
I know that to retrive data from database one should write Stored Prcocedures.

How have you come to know that? Whether that's true or not depends a lot on the circumstances of the application. It's definitely not a case of "should do".
Prithiraj Sen Gupta
Ranch Hand

Joined: Sep 13, 2006
Posts: 92
Sorry, I meant
I knew
not
I know
Prithiraj Sen Gupta
Ranch Hand

Joined: Sep 13, 2006
Posts: 92
Can you let me know any other way of retrieving.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40029
    
  28
I have been doing a bit of Databases, and people recommend stored procedures because they can be reused. You get a stored procedure which reads likeWhat that does is to encapsulate the query into a procedure. If you miss out the encapsulation you can use the line starting SELECT on its own, followed by ";" or whatever your database uses as a line terminator.
[ May 01, 2007: Message edited by: Campbell Ritchie ]
Prithiraj Sen Gupta
Ranch Hand

Joined: Sep 13, 2006
Posts: 92
Yes I know about stored procedures. But I want to know about alternate ways.

Thanks & Regards

Prithiraj Sen Gupta
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Alternate ways? Hasn't Ulf already answered that?

Originally posted by Ulf Dittmer:
Umm, the SQL SELECT statement?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC and Stored Procedure