zoukankan      html  css  js  c++  java
  • java.sql.SQLException: 不支持的字符集 (在类路径中添加 orai18n.jar): ZHS16GBK

    java.sql.SQLException: 不支持的字符集 (在类路径中添加 orai18n.jar): ZHS16GBK

    问题描述

    在使用 Mybatis 操作 Oracle 数据库时,报以下错误:

     
     
     
    1
    2021-05-09 22:13:49.747 ERROR 7664 --- [nio-8081-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.apache.ibatis.exceptions.PersistenceException: 
    2
    ### Error querying database.  Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'username' from result set.  Cause: java.sql.SQLException: 不支持的字符集 (在类路径中添加 orai18n.jar): ZHS16GBK
    3
    ### The error may exist in com/llm/mapper/oracleMapper/UserOracleMapper.java (best guess)
    4
    ### The error may involve com.llm.mapper.oracleMapper.UserOracleMapper.findAll
    5
    ### The error occurred while handling results
    6
    ### SQL: SELECT * FROM "USER"
    7
    ### Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'username' from result set.  Cause: java.sql.SQLException: 不支持的字符集 (在类路径中添加 orai18n.jar): ZHS16GBK] with root cause
    8
    9
    java.sql.SQLException: 不支持的字符集 (在类路径中添加 orai18n.jar): ZHS16GBK
    10
    at oracle.sql.CharacterSetUnknown.failCharsetUnknown(CharacterSetFactoryThin.java:233) ~[ojdbc8-19.8.0.0.jar:19.8.0.0.0]
    11
    at oracle.sql.CharacterSetUnknown.convert(CharacterSetFactoryThin.java:194) ~[ojdbc8-19.8.0.0.jar:19.8.0.0.0]
    12
    ...
     
     

    解决方法

    maven 仓库,引入orai18n.jar

    地址:https://mvnrepository.com/artifact/cn.easyproject/orai18n/12.1.0.2.0

     
     
     
    1
    <!-- https://mvnrepository.com/artifact/cn.easyproject/orai18n -->
    2
    <dependency>
    3
        <groupId>cn.easyproject</groupId>
    4
        <artifactId>orai18n</artifactId>
    5
        <version>12.1.0.2.0</version>
    6
    </dependency>
     
     
    Windy心梦无痕
  • 相关阅读:
    一个爬虫的练习(妹子图)
    安装模块出现的编译问题(解决)
    基于套接字通信的简单练习(FTP)
    Python3 之选课系统
    数据爬取后台(PHP+Python)联合作战
    让pip 使用国内镜像源
    为啥学蛇和python10年后的变化
    模拟登陆百度以及Selenium 的基本用法
    冒泡排序及其效率分析(无聊搞来玩玩)
    LLVM编译器
  • 原文地址:https://www.cnblogs.com/windy-xmwh/p/14749134.html
Copyright © 2011-2022 走看看