0
resultset = statemet.executequery("select shift+0 from sportman");

string x = resultset.getstring("shift");

but second line throw exception:

Column 'shift' not found.

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

2
  • have you tried resultset.getstring("shift+0"); ? Commented May 1, 2011 at 7:27
  • yes but it returned for example 45 but i want it was in the form of 01010 Commented May 1, 2011 at 7:32

1 Answer 1

1
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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.