How's about using :

int c1idat = Integer.parseInt(req.getParameterValues("C1IDAT")[0]);

You may want to to some catching of NumberFormatExceptions etc, depending on
how safe your input is

Also I advise using StringBuffer.append() instead of concatenating Strings
together like that.

StringBuffer parameters = new StringBuffer(c1cono);
parameters.append(",'").append(c1coco").append("','");
.
and so on...
.
.
parameters.toString() gives you the final String.

Simon

Jeetandra Mahtani wrote:

> Hello,
> This probably is a really simple question but I can't
> seem to get it working.
> I have retrieved a field from a from by the following:
> ..
> String c1idat = req.getParameterValues("C1IDAT")[0];
> ..
> Now, I need to get the int value of this string.
> The field in the table is of type S ( db2/400 ).
> The parameters are as :
> String parameters = c1cono + ",'" + c1coco + "','" +
> c1colo + "','" + c1qsit + "','" + c1qusr + "','" +
> c1emfq + "','" + c1susr + "','" + c1emfs + "','" +
> c1pusr + "','" + c1emfr + "','" + c1cusr + "','" +
> c1emfc + "','" + c1ema1 + "','" + c1ema2 + "'," +
> c1idat;
> All the other fields are of type A and only c1idat is
> of type S.
> I am pretty sure that if I can get the int value of
> c1idat, I should be able to add it.
> Any suggestions?
>
> _________________________________________________________
> DO YOU YAHOO!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to