Display zero filled integer on jdbc

时间:2016-04-04 17:32:18

标签: java

How to display zero filled int value from mysql as it is on java swing table?

As a example value in my table is 0001 but in java swing table it displays as 1.

I want to display as 0001.

1 个答案:

答案 0 :(得分:0)

you could try like this

  String result= offset+rs.getString(1);
  where String offset="000";// 111 etc