This is your third posting on this topic and this question contains no more usefull information than your other postings.
You've been given links to the tutorials!!!
Who know why your query isn't working. You are obviously doing something wrong.
Did you ever think to search the forum for working examples? To get data from a database you need to do a query to return a ResultSet. Did you think to search the forum using "resultset" as a keyword?
Learn to do some simple Problem Solving on your own. Given the lack of information you provide on your questions you aren't about to get any help from peoply here since we are not mind readers.