I performed database connectivity through java with db2 database. Database table name "CRID" and which contains column name "CRID". It's datatype is varchar. Currently value in crid column is 1. When I run the program it displays value present in CRID table and increment its value by one. Second time I run the program value is displayed as 2 and its value is incremented by one. But I want output to be displayed as 00001. when value is incremented next time it should display value as 00002. When its value reaches to 10, it should display output as 00010.
I tried in many ways to do this but i was not successful. following was my approach to do it but it was not successful. Value in database table, I saved it as 00001, so the first time it showed me output as 00001 but in second attempt it showed me output as 2.
Please tell me how to do it. Thank You