Solved

How to insert a STRING value here?

Posted on 2008-06-16
4
202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 250 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

728 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