Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and the fly likes regarding preparedstatement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Reply locked New topic
Author

regarding preparedstatement

yekkala krishna
Ranch Hand

Joined: Mar 04, 2007
Posts: 105
hi guys,

Shall we excuete select query with help of preparedstatement interface.

For example : select * from emp;

with regards
Y.rama krishna
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 688

I don't think that you need to use a PreparedStatement in this case. PreparedStatement objects are for when you repeatedly execute the same kind of query over-and-over again with different parameters.

In this case, I think that a regular Statement will serve you best.

Kaydell
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Hello yekkala krishna,

Please dont make duplicate posts. Your post is already answered here

Please continue it from there.
[ July 11, 2007: Message edited by: Raghavan Muthu ]

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
 
Consider Paul's rocket mass heater.
 
subject: regarding preparedstatement
 
Similar Threads
JDBC problem:Too few parameters. Expected 1
regarding preparedstatement
How to use the Date object
Simple SQL question
prepared statement -select- and?