Link to home
Start Free TrialLog in
Avatar of ogryn
ogryn

asked on

Achieiving the equivelent of PHPs mysql_result command in JSP

Hello,

How would I go about getting the same result as PHP's:

$query = mysql_query("SELECT * FROM RUNNINGINSTANCE WHERE UNITLINK = $param");
$instancename1 = mysql_result($query,0,"name");

would in JSP?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ogryn
ogryn

ASKER

Does the 1 in the follwing statement, equate to which row of the database you are reading from?

stmt.setString( 1, param ) ;

No, it sets the first ? in the prepares statement :-)

rslt.next() gets the next (first in this case) row of the resultset ready, then you can read the "name" field out of it
Avatar of ogryn

ASKER

ahh, thanks. I'm a really newbie at Java stuff. I've been using JSTL, but I need to step it up a gear. I'll give that a go. Thanks
Hope it works :-)

http://java.sun.com/developer/qow/archive/73/index.html

Should help too :-)

Good Luck!

Tim