Solved

How to insert a STRING value here?

Posted on 2008-06-16
4
197 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 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now