我写了个hibernate小程序,向数据库中插入中文,查询结果都是?,但是直接在mysql中插入中文没有问题。
jdbc:mysql://localhost:3306/db_eshop?useUnicode=true&characterEncoding=gb2312后面加了:
?useUnicode=true&characterEncoding=gb2312 程序就会报错。请高手指教
jdbc:mysql://localhost:3306/db_eshop?useUnicode=true&characterEncoding=gb2312后面加了:
?useUnicode=true&characterEncoding=gb2312 程序就会报错。请高手指教
这是在xml中的写法。
如果不是xml中。应该用:
jdbc:mysql://localhost:3306/db_eshop?useUnicode=true&characterEncoding=gb2312
吧。