This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

JDBC and Stored Procedure

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Umm, the SQL SELECT statement?
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Statement and PreparedStatement objects can be used to retrieve data from the database.
 
Prithiraj Sen Gupta
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I meant

I knew

not

I know

 
Prithiraj Sen Gupta
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you let me know any other way of retrieving.
 
Marshal
Posts: 68148
258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I know about stored procedures. But I want to know about alternate ways.

Thanks & Regards

Prithiraj Sen Gupta
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alternate ways? Hasn't Ulf already answered that?

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

 
I didn't say it. I'm just telling you what this tiny ad said.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!