Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to insert a STRING value here?

Posted on 2008-06-16
4
Medium Priority
?
205 Views
Last Modified: 2010-04-21
I have an action JSP page that has a CallableStatement to a stored procedure (SP).
In the statement I have each parameter listed that will be passed to the SP.
All of the parameters are set as request.getParameter("parameterName")); because they are parameters passed from a form.

What I want to do is change two of these and set them equal to a local string that is defined on the action page.  In other works, I want to use two local strings as two of the parameters for the CallableStatement instead of two of the form parameters that is passed.

Here is a code snippet of what I have today:
I want to change the "request.getParameter("TYPE"));"  to a local string value
What is the syntax for this?
CallableStatement cs = connection.prepareCall("{CALL CBSTDTFI.CMUPDATE39 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}");
 cs.setString(1,request.getParameter("TYPE"));
 cs.setString(2,request.getParameter("CURDATE"));

Open in new window

0
Comment
Question by:g118481
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 1000 total points
ID: 21798008
All you need to do is something like the following for each:
 cs.setString(1,someLocalString);

Open in new window

0
 
LVL 92

Expert Comment

by:objects
ID: 21798360
just replace request.getParameter() with the local string varibale you want to use

If its not a String then use setObject() instead of setString()

0
 
LVL 1

Author Closing Comment

by:g118481
ID: 31467792
Thank you for the quick response.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 21820081
:-)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question