Skip to content

Instantly share code, notes, and snippets.

@brfrn169
Created July 20, 2022 03:32
Show Gist options
  • Save brfrn169/9102296960a38ef190b9cbee7fc2a12a to your computer and use it in GitHub Desktop.
Save brfrn169/9102296960a38ef190b9cbee7fc2a12a to your computer and use it in GitHub Desktop.
Examples of how to get column values in Result
Result result = …;
// Get a Boolean value of a column
boolean booleanValue = result.getBoolean("<column name>");
// Get an Int value of a column
int intValue = result.getInt("<column name>");
// Get a BigInt value of a column
long bigIntValue = result.getBigInt("<column name>");
// Get a Float value of a column
float floatValue = result.getFloat("<column name>");
// Get a Double value of a column
double doubleValue = result.getDouble("<column name>");
// Get a Text value of a column
String textValue = result.getText("<column name>");
// Get a Blob value of a column (as a ByteBuffer)
ByteBuffer blobValue = result.getBlob("<column name>");
// Get a Blob value of a column as a byte array
byte[] blobValueAsBytes = result.getBlobAsBytes("<column name>");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment