Solved

How to insert a STRING value here?

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to get all the API from website? 11 92
stackato and cloud 4 86
diffSum example 4 37
Which non-HTML GUI front end to use with Java? 3 22
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

809 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