Class ConverterHelper
java.lang.Object
com.databricks.jdbc.api.impl.converters.ConverterHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectconvertSqlTypeToJavaType(int columnSqlType, Object object) Converts a SQL object to the appropriate Java object based on the SQL type.static ObjectconvertSqlTypeToSpecificJavaType(Class<?> javaType, int columnSqlType, Object obj) Converts an object to a specific Java type based on the provided SQL type and desired Java class.static ObjectConvertergetConverterForSqlType(int columnSqlType) Retrieves the appropriate ObjectConverter for a given SQL type.static booleanisConversionSupported(int fromType, int toType)
-
Constructor Details
-
ConverterHelper
public ConverterHelper()
-
-
Method Details
-
convertSqlTypeToJavaType
public static Object convertSqlTypeToJavaType(int columnSqlType, Object object) throws DatabricksSQLException Converts a SQL object to the appropriate Java object based on the SQL type.- Parameters:
columnSqlType- The SQL type of the column, as defined in java.sql.Typesobject- The object to be converted- Returns:
- The converted Java object
- Throws:
DatabricksSQLException- If there's an error during the conversion process
-
convertSqlTypeToSpecificJavaType
public static Object convertSqlTypeToSpecificJavaType(Class<?> javaType, int columnSqlType, Object obj) throws DatabricksSQLException Converts an object to a specific Java type based on the provided SQL type and desired Java class.- Parameters:
javaType- The Class object representing the desired Java typecolumnSqlType- The SQL type of the column, as defined in java.sql.Typesobj- The object to be converted- Returns:
- The converted object of the specified Java type
- Throws:
DatabricksSQLException- If there's an error during the conversion process
-
getConverterForSqlType
Retrieves the appropriate ObjectConverter for a given SQL type.- Parameters:
columnSqlType- The SQL type of the column, as defined in java.sql.Types- Returns:
- An ObjectConverter suitable for the specified SQL type
-
isConversionSupported
public static boolean isConversionSupported(int fromType, int toType)
-