No need to post the same question again - you could simply answer in the original question:
Retrieving the single row from MSSQL into the GUI window[
^]
I have posted 2 links. Read what is written there. You need to connect your program to the database - you can use JDBC for that (weblink 2). After you have established the connection you will need to ask the database for the desired data. How to create that query is described in weblink 1.
I also recommend to buy a book about general java programming. It's got the advantage that you do not need to know where to search. Most Java books cover the connection to a database via JDBC.