mysql - Select AS is not working properly with jdbc -
i using jtable display result of query. table not show xyz
columns shows xyz
header fields not existing in database(manipulated fields).
don't know of database internals.please forgive if it's basic.
rs1 = st1.executequery("select product.`id` `product id`,product.`serialnumber` `serial number`, product.`dop` `date of purchase` product product.`dop` between '"+from+"' , '"+to+"'"); reporttable.setmodel(buildtablemodel(rs1));
same query on query browser output:
product id serial number date of purchase 1 123244mf43m 08/08/2013
my output jdbc is:
id serialnumber dop //table header 1 123244mf43m 08/08/2013
there configuration setting described here:
http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html
useoldaliasmetadatabehavior
which, if set true (the default in 5.0.x) return aliases (if any) resultsetmetadata.getcolumnname() or resultsetmetadata.gettablename() rather original column/table name.
not sure if applicable you, cause.
Comments
Post a Comment