Class ConverterHelper


  • public class ConverterHelper
    extends Object
    • Constructor Detail

      • ConverterHelper

        public ConverterHelper()
    • Method Detail

      • 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.Types
        object - 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 type
        columnSqlType - The SQL type of the column, as defined in java.sql.Types
        obj - 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

        public static ObjectConverter getConverterForSqlType​(int columnSqlType)
        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)