DdlUtils
  1. DdlUtils
  2. DDLUTILS-38

Support for international date/time format in MSSQL

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 1.3
    • Component/s: Core - SqlServer
    • Labels:
      None

      Description

      MS SQL supports time, date, timestamp formats independents of locale in use. This patch set these formats as default (when no locale is set in SqlBuilder) to format date/time/timestamp values in SQL expressions.

      1. MSSqlBuilder.java
        10 kB
        JuanFran Adame Lorite
      2. SqlBuilder.java
        56 kB
        JuanFran Adame Lorite

        Activity

        Hide
        JuanFran Adame Lorite added a comment -

        The solution is not very elegant
        A new DateFormat appears in SqlBuilder class for formatting timestamp values, _valueDateTimeFormat, which is set in setLocaleValue.
        All _value[...]Format fields are declared as protected to be accessible from inheritance classes, as MSSqlBuilder is.
        MSSqlBuilder overrides getValueAsString method to implements the value formatting for time/date/timestamp column types, rest of column types formatting is delegated to super (SqlBuilder) method.

        Show
        JuanFran Adame Lorite added a comment - The solution is not very elegant A new DateFormat appears in SqlBuilder class for formatting timestamp values, _valueDateTimeFormat, which is set in setLocaleValue. All _value [...] Format fields are declared as protected to be accessible from inheritance classes, as MSSqlBuilder is. MSSqlBuilder overrides getValueAsString method to implements the value formatting for time/date/timestamp column types, rest of column types formatting is delegated to super (SqlBuilder) method.

          People

          • Assignee:
            Thomas Dudziak
            Reporter:
            JuanFran Adame Lorite
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development