How to pass query as parameter?

How to pass query as parameter?

Hi Friends,

I have a real tough time in finding the solution of a problem. I am here to find a real solution of my problem. Please help me solve this problem.
My Problem is:

I have 3 query..
String qry1="select id from table1";
String qry2="select name from table2";
String qry3="select age from table13";

string q=Insert into emp values(?,?,?);
int update=prep.executeUpdate(q);
prep.setString(1,qry1);
prep.setString(2,qry2);
prep.setString(3,qry3);
prep.executeUpdate();

In this, i am not able to pass the value of qry1,qry2,qry3...

Please help me to find the solution.

Its really urgent.......Please
View Answers









Related Tutorials/Questions & Answers:
how to debug parameters in the hibernate query
how can we pass parameters from jsp href to another servlet
Advertisements
How to pass query as parameter? - JSP-Servlet
Pass parameters from JSP to Servlet
How to pass and catch HTML parameters to a Java program using REST services?(without using servlet/jsp)
ModuleNotFoundError: No module named 'django-query-parameters'
write a program to demonstrate call by value and call by reference.(pass objects as parameters)
Passing Parameters in jsp
how to pass the parameter in callable statement
How to pass value of a link to a textfield
How do you pass a variable by value?
how to pass command line arguments in ant
how many max. arguments we pass to the any function ? how many max. arguments we pass to the any function ?
How to pass an arraylist from servlet to jsp?
How to pass javascript variable in Scriplet of JSP?
How to pass multiple values from a servlet to JSP?
In Struts 2 how to pass the <s: property value=''
How to pass command line arguments in Java?
How do I find out the number of parameters passed into function9. ?
SQL IN Parameters
How to pass value from dijit.Tree to dijit.MenuItem - Ajax
How to pass the value from controller to jsp page ?
how to pass class variable to another class
[JSP] How to pass back ID to previous page.
How can i pass the valus from a JSP to the action class???
how to pass a string from one class to another
Can anybody tell me how to use #parameters in struts 2 ?
how many max. arguments we pass to the any function ?
how to pass the mutiple values from <Ui:datagrid hyperlink - JSP-Servlet
How can I get the full URL with the attached parameters? - JSP-Servlet
how to pass the mutiple values from <Ui:datagrid hyperlink - JSP-Servlet
how to value of one variable pass in other variable in revetse order
How to Pass data from jTextField1 in jFrame1 to jLabel1 in jFrame2
the number of parameters
Passing Parameters to Another JSP Page
How to pass parametes from JSP page to HTML page? - JSP-Servlet
how to pass an array from one jsp to another jsp - JSP-Servlet
How to pass the value of Selected Value of combo box into sql ??
how to pass values from 2nd page tp 3rd page....
How to pass variable from one class to another in java
How to create wildcard query in Hibernate?
how to pass input from radio button to jsp page
how to pass input from radio button to jsp page
Passing Parameters - JSP-Servlet
how to pass input from radio button to jsp page
pass method reference in java
PASS value
How To Pass data from one GUI to another in java swing
how to pass form values from javascript of html page to jsp page
How to pass Array of string from action class to jsp page

Ads