search

Home  >  Q&A  >  body text

mysql - java ResultSetMetaData gets Chinese alias garbled

  1. code show as below:

2. If the alias is Chinese resultSetMetaData.getColumnName(i 1), this code will get garbled data.

3. The Chinese in the result set is normal.
4.mysql character settings are as follows

天蓬老师天蓬老师2744 days ago598

reply all(1)I'll reply

  • 阿神

    阿神2017-05-17 10:10:49

    Add encoding parameters after the JDBC url

    ?useUnicode=true&characterEncoding=UTF-8

    reply
    0
  • Cancelreply