开发者

problem with bit in mysql

开发者 https://www.devze.com 2023-03-02 02:07 出处:网络
resultset = statemet.executequery(\"select shift+0 from sportman\"); string x = resultset.getstring(开发者_StackOverflow社区\"shift\");
resultset = statemet.executequery("select shift+0 from sportman");

string x = resultset.getstring(开发者_StackOverflow社区"shift");

but second line throw exception:

Column 'shift' not found.

shift is bit(8) and i want to show it to form '000101'.


Integer.toBinaryString(Integer.valueOf(resultset.getString("shift+0")))

Result is not zero-padded to the width you want though. You may need to add that yourself later.

0

精彩评论

暂无评论...
验证码 换一张
取 消