Created
July 20, 2022 03:32
-
-
Save brfrn169/9102296960a38ef190b9cbee7fc2a12a to your computer and use it in GitHub Desktop.
Examples of how to get column values in Result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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