Re: Translate attempt
- From: RedGrittyBrick <RedGrittyBrick@xxxxxxxxxxxxx>
- Date: Mon, 30 Jun 2008 10:00:21 +0100
francan00@xxxxxxxxx wrote:
I am trying to translate the PHP script into Java.
[snip]
My attempt in Java and it is giving me errors with getClientId part
I always cut and paste exact error messages into newsgroup postings - otherwise you are hiding information vital to solving your problem. Why make people guess what the error message might be?
and lost in fetching array part. Please advise any corrections I
need?
Java:
//db connection part here...
try {
String res = "";
if(getParameter("getClientId")) {
Presumably this is within
public class SomeServlet extends HttpServlet {
res = stmt.executeQuery("select * from tableOne where clientID='" +
getParameter("getClientId") + "');
String $inf [];
Unless this is some variant of Java I am unfamiliar with, variable names should not be prefixed with a dollar sign.
if($inf.equals(getParameterValues($res)) {
and array elements should be indexed - e.g. if (inf[0].equals(...)) {
--
RGB
.
- Follow-Ups:
- Re: Translate attempt
- From: Lew
- Re: Translate attempt
- References:
- Translate attempt
- From: francan00
- Translate attempt
- Prev by Date: Re: invalid archives with java.util.zip
- Next by Date: Re: X.509 cert not exporting CA chain?
- Previous by thread: Translate attempt
- Next by thread: Re: Translate attempt
- Index(es):
Relevant Pages
|