Syntax in select statement

Could you please explain me where is the difference between passing integer to "where" clause and string.

if I use like this:

("select * from table_name where id=" + id)-return to me everything what i need exactly,

but in case when I use

("select * from table_name where name = " + myname)-

get error message:Too few parameters,expected 1

I got myname from the form like

<%String myname = request.getParameter("name")%>

What the problem?I just start to work with JSP

Thank's for everybody

[563 byte] By [marinaR] at [2007-9-26 2:02:02]
# 1
Try putting single quotes around the value of the string, like ("select * from table_name where name='" + myname + "'")
svenkatesh13 at 2007-6-29 8:43:03 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Result the same-doesn't workThere are was an error java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
marinaR at 2007-6-29 8:43:03 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Try checking to make sure that the code 'request.getParameter("name")' actually returns a non-null and non-empty string. If it returns null, then it means that the parameter 'name' was never sent with this request. If it returns an empty string, it means that the parameter 'name' was received with the request but never had a value with it.

hungyee at 2007-6-29 8:43:03 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...