首页 > 数据库 >解决 Error querying database. Cause: org.postgresql.util.PSQLException: ��������: �û� "postgres&

解决 Error querying database. Cause: org.postgresql.util.PSQLException: ��������: �û� "postgres&

时间:2023-04-27 21:24:57浏览次数:38  
标签:core PSQLException catalina java postgres ibatis org apache querying

最近做数据库作业做得很崩溃,本来就没学过java,结果还要用mybatis+servlet+jsp,,,,,没办法还是得学啊TT

遇到个特别无语的报错:

### Error querying database.  Cause: org.postgresql.util.PSQLException: ��������: �û� "postgres" Password ��֤ʧ��
### The error may exist in com/test/entity/gradeMapper.xml
### The error may involve gradeMapper.findGrade
### The error occurred while executing a query
### Cause: org.postgresql.util.PSQLException: ��������: �û� "postgres" Password ��֤ʧ��
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:156)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142)
    at com.test.dao.gradeDaoImpl.findbycname(gradeDaoImpl.java:13)
    at com.test.servlet.ShowServlet.service(ShowServlet.java:43)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:673)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:389)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.postgresql.util.PSQLException: ��������: �û� "postgres" Password ��֤ʧ��
    at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:693)
    at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:203)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:258)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:54)
    at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:263)
    at org.postgresql.Driver.makeConnection(Driver.java:443)
    at org.postgresql.Driver.connect(Driver.java:297)
    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:189)
    at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:228)
    at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:223)
    at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.getConnection(UnpooledDataSource.java:96)
    at org.apache.ibatis.datasource.pooled.PooledDataSource.popConnection(PooledDataSource.java:452)
    at org.apache.ibatis.datasource.pooled.PooledDataSource.getConnection(PooledDataSource.java:100)
    at org.apache.ibatis.transaction.jdbc.JdbcTransaction.openConnection(JdbcTransaction.java:145)
    at org.apache.ibatis.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:67)
    at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:345)
    at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:89)
    at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:64)
    at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:333)
    at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158)
    at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:110)
    at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:90)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154)
    ... 27 more

看到乱码一直以为是编码的问题,gbk、utf-8都改过了,数据库名称啥的也不是中文,还是不行,,,,,,

后来发现是全局配置文件里面数据库的密码写错了,,,,,

这里的密码不是启动pgAdmin时输入的密码!!!!!!

 

标签:core,PSQLException,catalina,java,postgres,ibatis,org,apache,querying
From: https://www.cnblogs.com/05-ReFrain-19/p/17360232.html

相关文章

  • DataX-在Windows上实现postgresql同步数据到mysql
    场景DataX-阿里开源离线同步工具在Windows上实现Sqlserver到Mysql全量同步和增量同步:https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/130330353在上面实现sqlserver到mysql的数据同步之后,如果要实现postgresql到mysql数据同步流程一样。以PostGis中的OGC元数据......
  • 对数据库中存储的程序进行现代化改造,以使用 Amazon Aurora PostgreSQL 联合查询、pg_c
    作为数据库迁移和现代化的一部分,您可以继续使用存储的程序和调度作业,将远程实例中的数据整合到集中式数据存储中。 AmazonSchemaConversionTool(AmazonSCT)可帮助您将传统的Oracle和SQLServer函数转换为其等效的开源函数。但是,如何继续使用存储的程序从远程数据库中提取数......
  • PostgreSQL统计信息
    转:PostgreSQL统计信息-阿里云开发者社区(aliyun.com)(96条消息)PG统计信息_pg_stats_三思呐三思的博客-CSDN博客1.数据库统计信息概览2.pg_stat_database关键指标postgres=#select*frompg_stat_databasewheredatname='postgres';-[RECORD1]-----+--------------......
  • rockyLinux 初体验(教程)PostgreSQL15
    目录数据库软件PostgreSQL安装数据库软件PostgreSQL配置数据库软件PostgreSQL交互通用数据库管理软件DBeaver彼时,PostgreSQL已经更新到了15.2。距离我上一次写PostgreSQL教程2022-03-20,已经过去一年多了。Linux篇PostgreSQL教程很久之前就想写了,一直停留在想法上......
  • 数据库占用大量内存的检测和优化(PostgreSQL)
    select*frompg_stat_user_tableswheren_live_tup>100000andseq_scan>0orderbyseq_tup_readdesclimit10;这个SQL查询用于检查在PostgreSQL数据库中,哪些用户表(usertables)的行数(livetuples)超过100,000,且进行了顺序扫描(sequentialscans)。查询结果会按顺序......
  • PostgreSQL插件那么多,怎样管理最高效?
    摘要:华为云RDSforPostgreSQL通过插件管理功能,很好地解决了PostgreSQL版本与插件耦合的问题,帮助用户更直观、更快速地安装管理数据库插件。本文分享自华为云社区《PostgreSQL插件那么多,怎样管理最高效?》,作者:GaussDB数据库。云服务环境下,如何让客户更方便地在各个PostgreSQL的......
  • lightdb/postgresql中的统计信息详解
    和oracle,lightdb也支持单列和多列统计信息,见14.2. StatisticsUsedbythePlanner(light-pg.com)。默认情况下,analyze收集的统计信息是针对单列的,多个列之间通常没有依赖关系,在多个where里面,这容易导致基数计算失真。planner使用statistics的方式,在sql执行的plan步骤,Chapter......
  • 获取表中每个类型最新一条记录【Postgresql】
    每条数据的编号:row_number()分组排序:over(partitionby分组的字段orderby排序的字段)num=1:对分组后的数据获取第一条,也就是最新一条SELECT*FROM(SELECTROW_NUMBER()over(PARTITIONBYidORDERBYtimeDESC)ASnum,*FROMmonitordatawheretime>'2023-04-259:0......
  • Ubuntu postgresql
    Ubuntu#Createthefilerepositoryconfiguration:sudosh-c'echo"debhttp://apt.postgresql.org/pub/repos/apt$(lsb_release-cs)-pgdgmain">/etc/apt/sources.list.d/pgdg.list'#Importtherepositorysigningkey:wget--quiet-......
  • ubuntu22.4.1 部署Postgres12 、PostGIS、TimescaleDB
    参考文章https://www.postgresql.org/download/linux/ubuntu/一、postgres数据库安装#Createthefilerepositoryconfiguration:1.sudosh-c'echo"debhttp://apt.postgresql.org/pub/repos/apt$(lsb_release-cs)-pgdgmain">/etc/apt/sources.list.d/pgdg.l......