C99999 format in java to be used in sql

122 views Asked by At

i have a number with format "C99999"

i need import it to sql

i try this

while (rs.next()){
         int s=rs.getInt("Number");
        s++;

        String n = String.format("%05d",s);
        view.txtcustomernumber.setText(n);

how to add "C" into this format and the data type in mysql is int

1

There are 1 answers

2
C. K. Young On

Just use "C%05d" as the format string.