Spring Framework
  1. Spring Framework
  2. SPR-9550

Properties in the JDBC URL got stripped out for Mysql connector

    Details

    • Last commented by a User:
      true

      Description

      Mysql connector allows to specify many properties in the jdbc URL for different purposes. Some features are only available this way. However when a query is performed through Spring jdbcTemplate, the properties set in the URL have no effect.

      For example, using "jdbc:mysql://localhost:3306/mydb?includeThreadNamesAsStatementComment=true" with 5.1.15 connector can show the Java thread name in the "show processlist" output, a great feature for debugging. If jdbc API is used directly the thread name shows up as expected, but not so if the query is made through jdbc template.

        Activity

        Hide
        Chris Beams added a comment -

        Added Thomas Risberg as a watcher. @Thomas, does this issue ring a bell to you?

        Show
        Chris Beams added a comment - Added Thomas Risberg as a watcher. @Thomas, does this issue ring a bell to you?
        Hide
        Thomas Risberg added a comment -

        No, but I don't see why using Spring would make a difference. We would need to see a test case or at least the configuration files.

        Show
        Thomas Risberg added a comment - No, but I don't see why using Spring would make a difference. We would need to see a test case or at least the configuration files.
        Hide
        Chris Beams added a comment -

        Rui,

        Please consider following the instructions for submitting a reproduction project at https://github.com/SpringSource/spring-framework-issues#readme so that we can see this behavior for ourselves.

        Show
        Chris Beams added a comment - Rui, Please consider following the instructions for submitting a reproduction project at https://github.com/SpringSource/spring-framework-issues#readme so that we can see this behavior for ourselves.
        Hide
        Rui Li added a comment -

        Here is a small app that shows this problem. It seems that it has something to do with the hibernate support. The java thread name is shown as expected if jdbcTemplate is used instead.

        A Mysql java connector with version later than 5.1.13 is needed.

        Thanks.

        Show
        Rui Li added a comment - Here is a small app that shows this problem. It seems that it has something to do with the hibernate support. The java thread name is shown as expected if jdbcTemplate is used instead. A Mysql java connector with version later than 5.1.13 is needed. Thanks.

          People

          • Assignee:
            Chris Beams
            Reporter:
            Rui Li
            Last updater:
            Chris Beams
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Days since last comment:
              1 year, 34 weeks, 4 days ago