Get the App
SLTechnology News&Howtos  ›  Database  › 

About spring jdbc when querying the mysql database, the dataset field name has an alias that returns not the alias but the original field name

Shulou Source: shulou.com Published: 2022-06-01 12:44:36 09月14日 Update

The select statement field contains an alias

Eg:select xm fullname from t_user

Result set returned by JdbcTemplate query

Xm

'Zhang San'

'xxx'

'xxxx'

The expected result is:

Fullname

'Zhang San'

'xxx'

'xxx'

Solution: follow the database link url? UseOldAliasMetadataBehavior=true

Tags: Results Zhang San aliases fields data databases queries methods statements links original but Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple macOS NVidia Linux Microsoft