public boolean sendsStringParametersAsUnicode() {
    """
	Determines if the SQL Server instance assigns Unicode data types (e.g. nvarchar) to strings.
	
	@return true if the SQL Server instance uses Unicode types by default, false if not.
    """
        if (sendsStringParametersAsUnicode == null) {
            try {
                if (getConnection() instanceof JdbcConnection) {
                    PreparedStatement ps = null;
                    ResultSet rs = null;
                    try {
                        String sql = "SELECT CONVERT([sysname], SQL_VARIANT_PROPERTY(?, 'BaseType'))";
                        ps = ((JdbcConnection) getConnection()).prepareStatement(sql);
                        ps.setString(1, "Liquibase");
                        rs = ps.executeQuery();
                        String baseType = null;
                        if (rs.next()) {
                            baseType = rs.getString(1);
                        }
                        // baseTypes starting with "n" can be something like nvarchar (or nchar)
                        sendsStringParametersAsUnicode =
                            (baseType == null) || baseType.startsWith("n");
                    } finally {
                        JdbcUtils.close(rs, ps);
                    }
                } else if (getConnection() instanceof OfflineConnection) {
                    sendsStringParametersAsUnicode =
                        ((OfflineConnection) getConnection()).getSendsStringParametersAsUnicode();
                }
            } catch (SQLException | DatabaseException e) {
                Scope.getCurrentScope().getLog(getClass()).warning(
                    LogType.LOG, "Cannot determine whether String parameters are sent as Unicode for MSSQL", e);
            }
        }

        return (sendsStringParametersAsUnicode == null) ? true : sendsStringParametersAsUnicode;
    }
public boolean sendsStringParametersAsUnicode() {
        if (sendsStringParametersAsUnicode == null) {
            try {
                if (getConnection() instanceof JdbcConnection) {
                    PreparedStatement ps = null;
                    ResultSet rs = null;
                    try {
                        String sql = "SELECT CONVERT([sysname], SQL_VARIANT_PROPERTY(?, 'BaseType'))";
                        ps = ((JdbcConnection) getConnection()).prepareStatement(sql);
                        ps.setString(1, "Liquibase");
                        rs = ps.executeQuery();
                        String baseType = null;
                        if (rs.next()) {
                            baseType = rs.getString(1);
                        }
                        // baseTypes starting with "n" can be something like nvarchar (or nchar)
                        sendsStringParametersAsUnicode =
                            (baseType == null) || baseType.startsWith("n");
                    } finally {
                        JdbcUtils.close(rs, ps);
                    }
                } else if (getConnection() instanceof OfflineConnection) {
                    sendsStringParametersAsUnicode =
                        ((OfflineConnection) getConnection()).getSendsStringParametersAsUnicode();
                }
            } catch (SQLException | DatabaseException e) {
                Scope.getCurrentScope().getLog(getClass()).warning(
                    LogType.LOG, "Cannot determine whether String parameters are sent as Unicode for MSSQL", e);
            }
        }

        return (sendsStringParametersAsUnicode == null) ? true : sendsStringParametersAsUnicode;
    }
public boolean sendsStringParametersAsUnicode ( ) { if ( sendsStringParametersAsUnicode == null ) { try { if ( getConnection ( ) instanceof JdbcConnection ) { PreparedStatement ps = null ; ResultSet rs = null ; try { String sql = "SELECT CONVERT([sysname], SQL_VARIANT_PROPERTY(?, 'BaseType'))" ; ps = ( ( JdbcConnection ) getConnection ( ) ) . prepareStatement ( sql ) ; ps . setString ( 1 , "Liquibase" ) ; rs = ps . executeQuery ( ) ; String baseType = null ; if ( rs . next ( ) ) { baseType = rs . getString ( 1 ) ; } // baseTypes starting with "n" can be something like nvarchar (or nchar) sendsStringParametersAsUnicode = ( baseType == null ) || baseType . startsWith ( "n" ) ; } finally { JdbcUtils . close ( rs , ps ) ; } } else if ( getConnection ( ) instanceof OfflineConnection ) { sendsStringParametersAsUnicode = ( ( OfflineConnection ) getConnection ( ) ) . getSendsStringParametersAsUnicode ( ) ; } } catch ( SQLException | DatabaseException e ) { Scope . getCurrentScope ( ) . getLog ( getClass ( ) ) . warning ( LogType . LOG , "Cannot determine whether String parameters are sent as Unicode for MSSQL" , e ) ; } } return ( sendsStringParametersAsUnicode == null ) ? true : sendsStringParametersAsUnicode ; }
Determines if the SQL Server instance assigns Unicode data types (e.g. nvarchar) to strings.

@return true if the SQL Server instance uses Unicode types by default, false if not.
Determines if the SQL Server instance assigns Unicode data types ( e . g . nvarchar ) to strings .