i'm using jooq , postgres. in postgres have column gender:
'gender' gender,
(the table view , gender column placeholder value gets calculated in java)
in java when .fetch() view, calculations on each record:
(record r : skillrecords) { idnumber=function(r) r.set(id, idnumber); r.set(gender,getgender(idnumber)); }
all looks , if println values they're correct. however, when call intoresultset() on skillsrecord, gender column has asterisks next values, eg "*male".
then, use resultset input opencsv csv writer , when open csv gender column comes out null.
any suggestions?
update:
following input lukas regarding asterisks, realise issue opencsv.
my code follows:
file tempfile = new file("/tmp/file.csv"); bufferedwriter out = new bufferedwriter(new filewriter(tempfile)); csvwriter writer = new csvwriter(out); //code getting records sits here (record r : skillrecords) { idnumber=function(r) r.set(id, idnumber); r.set(gender,getgender(idnumber)); } writer.writeall(skillrecords.intoresultset(), true); return tempfile;
all columsn in csv come expected, except gender column, has header "gender" column values empty. have necessary try/catches in code above i've excluded them brevity.
the asterisk in *male
the asterisk see in resultset.tostring()
output (or in result.tostring()
) reflects record's internal record.changed(field)
flag, i.e. information on each record says record modified after retrieved form database (which did).
that visual information can safely ignore.
Comments
Post a Comment