Re: Translate attempt



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
.



Relevant Pages

  • RE: JAVA un z/OS
    ... Additionally in the case of primitive integers, Java has to ... from Little Endian to Big Endian before sending the CPU instruction, ... than back after the instruction is done. ...
    (bit.listserv.ibm-main)
  • Re: Is a "real" C-Python possible?
    ... I think most Java-Python benchmarks you can find online will indicate ... Java 1.1) piece of a paper if you read past the "benchmark" part. ... (snip rant about Swing memory leaks, ... Don't write large apps ...
    (comp.lang.python)
  • Re: Great SWT Program
    ... Java Search and Plug-in Search. ... to use Eclipse I'd teach them it's internal search tools. ... (command-line tools as well as an IDE) ...
    (comp.lang.java.programmer)
  • Re: Text Files In MSIE (was: Flame Bait! Windows vs: The Unices)
    ... Programmer Dude wrote: ... [big snip] ... >> behavior I want from IE I need to make changes in the registry? ... >with a Windows Java hardcore user) to derive a .reg file that would ...
    (comp.programming)
  • Re: String replacement( 2 slashes-> 4 slashes )
    ... string literals and quadruple them in regex literals. ... I suggest solving the problem first with forward slashes. ... Coaching, problem solving, economical contract programming. ... See http://mindprod.com/jgloss/jgloss.html for The Java Glossary. ...
    (comp.lang.java.programmer)