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心梦无痕
  • 相关阅读:
    python爬虫模拟登陆
    华为手机怎么连接苹果电脑?
    python 3 爬取百度图片
    让Netty入门变得简单
    ylbtech-LanguageSamples-UserConversions(用户定义的转换)
    ylbtech-LanguageSamples-Unsafe(不安全代码)
    ylbtech-LanguageSamples-Threading(线程处理)
    ylbtech-LanguageSamples-Struct(结构)
    ylbtech-LanguageSamples-SimpleVariance
    ylbtech-LanguageSamples-Security(安全)
  • 原文地址:https://www.cnblogs.com/windy-xmwh/p/14749134.html
Copyright © 2011-2022 走看看