This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hi. I have an application where, I want the user to be able to key in a vendor number and have the record for that number displayed. I have a select bean accessing the database, but I'm a bit confused on how to retrieve certain records. I want to say, select records where vendor number is equal to, whatever the value is keyed in the JTextField. Could someone please help? (Just to let you know, I am a newbie 100%, so take it easy on me!) Thanks in advance!
Jennifer, This isn't the correct forum to display this question since it's not directly related to IDE. I'm just not sure whether to move it to JFC/Swing or JDBC. I'm not even sure your question is JDBC related, so I'll move it to JFC/Swing and maybe someone can help you on the JTextField part. -Peter
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