Advertisement

03.07.2008 at 04:37AM PST, ID: 23222660
[x]
Attachment Details

SQL query in Java with variable in where clause

Asked by chelsia11 in Java Programming Language

I am trying to execute a SQL Query from Java.

String c_Name="USA";

String strQuery =  "select name from multiple_value where object_name = 'HUB_'\"+c_Name";

I want the value of c_Name to be replaced at runtime based on the value of c_Name. So query when evaluted should look like

String strQuery =  "select name from multiple_value where object_name = 'HUB_USA";

Please let me know how to do this.
Start Free Trial
 
Keywords: SQL query in Java with variable in wh…
 
Loading Advertisement...
 
[+][-]03.07.2008 at 04:40AM PST, ID: 21069388

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.07.2008 at 04:41AM PST, ID: 21069393

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.07.2008 at 04:44AM PST, ID: 21069413

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.

 
[+][-]03.07.2008 at 04:58AM PST, ID: 21069490

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
Sign Up Now!
Solution Provided By: thomas908
Participating Experts: 2
Solution Grade: A
 
 
[+][-]03.07.2008 at 06:36AM PST, ID: 21070368

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.

 
[+][-]09.18.2008 at 09:03PM PDT, ID: 22517898

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.

 
[+][-]09.24.2008 at 03:24PM PDT, ID: 22564655

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 / EE_QW_2_20070628