简体   繁体   中英

How to get data of a specific field from mySQL into a JLabel in java?

I have a table in mySQL called classes that have 2 columns, Class Name and Class Time, in front of each class name is its time. in java I have made a window that has 8 Jlabels, 4 on the left and 4 on the right beside them. the 4 on the left is the classes names, I wrote them down. the other 4 which are on the right is empty, I want to get the class time of of a specific class and put it beside the class. (get the class time of swimming class and put it in the empty label next to it)

could you please help me, it's about a project I am working on.

thank you.

Welcome in SO !
For your question you have to read Java ResultSet docs .
Of course, you can check this example that was very helpfull for me Searching daata and stting on JLabel .
Instead of none having much information, i hope it helps.
Good luck

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM