在学习ssh框架是发现,检索条件是英文时,sql就能按照条件过滤出数据,当我换成中文是,检索出来的数据就是空,最后发现没有设置数据库连接url的编码格式

1.数据库编码

COLLATE='utf8_general_ci'

2.jsp编码

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

3.连接url编码

jdbc:mysql://127.0.0.1:3306/sshdb?useUnicode=true&characterEncoding=utf-8


相关文章:

  • 2022-12-23
  • 2021-08-27
  • 2022-01-12
  • 2021-06-17
  • 2021-12-28
  • 2022-12-23
  • 2021-07-17
  • 2022-12-23
猜你喜欢
  • 2022-01-16
  • 2021-08-28
  • 2022-03-01
  • 2021-12-13
  • 2021-11-07
相关资源
相似解决方案