do it like this...it should work... --------------------------------------------- ............ ............
if (rs.next()) String updateip ="Update tbluser set incomingip= '" + request.getRemoteAddr() + "' where uname ='" + uname + "'"; ----------------------------------------------- Note the positions of apostrophe and double quotes... around request.getRemoteAddr() regards, Chintan -----Original Message----- From: Miao, Franco CAWS:EX [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 10:48 AM To: '[EMAIL PROTECTED]' Subject: How to put getRemoteAddr() into SQL server table in Tomcat 4.0 ? Source code: --------------------------------------------- ............ ............ if (rs.next()) String updateip ="Update tbluser set incomingip= 'request.getRemoteAddr()' where uname ='" + uname + "'"; ----------------------------------------------- No erro come up, but it didn't put remote Ip address into SQL server's table, value is "null", if I change to " '+request.getRemoteAddr()+' ", you will see '+request.getRemoteAddr()+' as the value in SQL table. Don't know why, looks like request.getRemoteAddr() doesn't function in SQL statement. Pls advise, thanks! Franco