Package dev.frostlake.jdbc
Class DirectStruct
java.lang.Object
dev.frostlake.jdbc.DirectStruct
- All Implemented Interfaces:
Struct
JDBC Struct implementation for Frostlake SQL Engine.
Represents SQL STRUCT/ROW type with named fields.
-
Constructor Summary
ConstructorsConstructorDescriptionDirectStruct(String typeName, String[] attributeNames, Object[] attributes) Create a Struct from attribute names and valuesDirectStruct(String typeName, Map<String, Object> fields) Create a Struct from a Map of field names to values -
Method Summary
Modifier and TypeMethodDescriptionasMap()Get this struct as a Mapvoidfree()getAttribute(int index) Get a specific attribute by index (1-based)getAttribute(String name) Get a specific attribute by nameString[]Get the attribute names (field names) of this structObject[]Object[]getAttributes(Map<String, Class<?>> map) intsize()Get the number of attributes in this structtoString()
-
Constructor Details
-
DirectStruct
Create a Struct from attribute names and values -
DirectStruct
Create a Struct from a Map of field names to values
-
-
Method Details
-
getSQLTypeName
- Specified by:
getSQLTypeNamein interfaceStruct- Throws:
SQLException
-
getAttributes
- Specified by:
getAttributesin interfaceStruct- Throws:
SQLException
-
getAttributes
- Specified by:
getAttributesin interfaceStruct- Throws:
SQLException
-
getAttributeNames
Get the attribute names (field names) of this struct- Throws:
SQLException
-
getAttribute
Get a specific attribute by name- Throws:
SQLException
-
getAttribute
Get a specific attribute by index (1-based)- Throws:
SQLException
-
asMap
Get this struct as a Map- Throws:
SQLException
-
size
Get the number of attributes in this struct- Throws:
SQLException
-
toString
-
free
- Throws:
SQLException
-