开发者

Printing a MySql results set in java

How can we print the data of a mysql results set on the printer with correct alignments of each data rows and column开发者_如何转开发s? Lets say, we get a dataset from a mysql database and populate that data in to a JTable, out of that JTable is there a way to get a printed hard-copy without any borders and lines of the JTable?


You need to pad each column with spaces and make it the same length as the column size.


Java has the System.out.printf method, which works like the printf of C with a format String and varargs.

I think for DB reports it is more convenient on the long run to use a Report Generator like iReport.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜