I have created a database using MS SQL named "Company" and there is a table named "Employee".

I need to print the records from the "Employee" table to a JTextArea keeping tabs for each columns in the JTextArea. How can i do it? Please help.

Why don't you use JTable?

Why don't you use JTable?

OK, even if I use JTable how will I be able to get the data from MS SQL database to the table?

Using JTable is my second option to pursue with this exersice, but it would be great if you help me with my primary option. That is using JtextArea,

You need to connect to database and run query to get what ever data you need(general tutorial how to access database can be found here). Then format received data in such way so you can insert them in JTable (as per link in my first reply)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.