public final class ConversionsUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
convertToByteArray(Object x)
Converts an object of one these types to a byte array for storage in a column of type
blob:
byte[]
ByteArrayInputStream
Blob
Clob
NClob (this is handled as Clob since it's just a superinterface of this one)
|
static Instant |
convertToInstant(Object x)
Converts an object of one these types to a
Instant for storage in a column of type timestamp:
LocalDateTime
Timestamp
Date
Calendar
OffsetDateTime
|
static LocalDate |
convertToLocalDate(Object x)
|
static LocalTime |
convertToLocalTime(Object x)
|
public static byte[] convertToByteArray(Object x) throws SQLException
blob:
byte[]ByteArrayInputStreamBlobClobNClob (this is handled as Clob since it's just a superinterface of this one)x - The object to convert.SQLException - when the type of the object to convert is not supported.public static LocalDate convertToLocalDate(Object x) throws SQLException
LocalDate for storage in a column of type date:
x - The object to convert.LocalDate instance resulting of the object conversion.SQLException - when the type of the object to convert is not supported.public static LocalTime convertToLocalTime(Object x) throws SQLException
LocalTime for storage in a column of type time:
x - The object to convert.LocalTime instance resulting of the object conversion.SQLException - when the type of the object to convert is not supported.public static Instant convertToInstant(Object x) throws SQLException
Instant for storage in a column of type timestamp:
x - The object to convert.LocalTime instance resulting of the object conversion.SQLException - when the type of the object to convert is not supported.Copyright © 2020–2024 ING Bank. All rights reserved.