Advertisement

03.31.2004 at 04:09PM PST, ID: 20939423
[x]
Attachment Details

Java-JDBC Statement Vs PreparedStatement

Asked by rameshaa in Java Programming Language

Tags: statement, vs, preparedstatement, java, jdbc

Hi,
 I'm using Java JDBC Statement to do select/insert/update data.
 All my stmt.executeQuery()/stmt.executeUpdate() are executed
 only once. (not in a loop) I have around 2000 of these Statements
 in my application.Its a web based project and deployed into IBM WebSphere.

 From the readbility point of view I hate my half page SQL string statement
 and also lot of String concatenation or stringbuffer.append().
 I understand that using PreparedStatement will decrease performance
 since all my SQL statements are executed only once. But it gives the
 elegant look and no string/stringbuffer operations. ok

 Can I solve the issue of readability and avoiding String concatenation by
 using PreparedStatement but without loosing the performance.
 Is there anywhere (jdbc or driver or database) I can set something (some flag or variable)
 so that I can use preparedstatement (thus good readbility, no more string operations)
 and still maintaining same performance as Statement ???
 
Thanks in advance.Start Free Trial
[+][-]03.31.2004 at 04:11PM PST, ID: 10728452

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Programming Language
Tags: statement, vs, preparedstatement, java, jdbc
Sign Up Now!
Solution Provided By: objects
Participating Experts: 7
Solution Grade: A
 
 
[+][-]03.31.2004 at 04:11PM PST, ID: 10728457

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]03.31.2004 at 04:12PM PST, ID: 10728461

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.31.2004 at 04:15PM PST, ID: 10728480

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.31.2004 at 09:32PM PST, ID: 10729742

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]03.31.2004 at 10:51PM PST, ID: 10729980

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.01.2004 at 12:13AM PST, ID: 10730296

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.01.2004 at 03:56AM PST, ID: 10731292

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.01.2004 at 05:08AM PST, ID: 10731620

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.01.2004 at 08:45AM PST, ID: 10733441

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.01.2004 at 08:49AM PST, ID: 10733485

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.01.2004 at 09:31AM PST, ID: 10733870

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.01.2004 at 10:50PM PST, ID: 10738750

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.02.2004 at 02:13AM PST, ID: 10739505

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.02.2004 at 02:54PM PST, ID: 10745133

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.08.2004 at 12:44PM PDT, ID: 10786580

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.09.2004 at 12:53PM PDT, ID: 10793917

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.14.2004 at 12:05AM PDT, ID: 10820925

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.14.2004 at 06:54AM PDT, ID: 10823410

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.11.2004 at 10:27AM PDT, ID: 11042711

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]05.15.2004 at 05:47AM PDT, ID: 11075319

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32