This is probably more a JDBC question. Unless the bean is an
EJB question, then it belongs in EJBC.
But to answer. Using JDBC, you have method that takes an integer that is the key, let's say. you create a preparedStatement in which the where clause has a question mark. In the query text it looks like this:
"Select * from table where key = ?"
the statement class I belevie has a method that will substitute the integer you passed to the method in place of the question mark,
you then executre the prepared statement, and it returns a resultSet with the record(s)
Hope this helps
Mark