sharding-proxy连接postgresql报错:Cannot find JDBC type '2003'
铁衣 2020-02-14 07:27:56 最近项目要用到分库分表,看了一些当前的分库分表中间件,感觉sharding-proxy还可以于是就尝试了一下。
本地用Navicat Premium15.0.4访问sharding-proxy服务。
碰到几个比较奇怪的问题,始终找不到原因,想请问高手帮忙看看。
第一个问题是本地的Navicat Premium上能显示测试连接成功。
保存连接后双击连接名。
本来的话,双击连接名应该能看到当前连接下的所有数据库列表,但我总是看不到。
仅仅只是连接名称的颜色从灰色变为绿色,没有向下展开数据库列表。
右键连接名称-->创建新的查询,这个时候会弹出一个查询窗口,在这个窗口写入SQL可以成功执行的(说明数据库是成功连接上了)。
但为什么就是看不到数据库列表呢?
另外就是sharding-proxy服务器上的日志总是在报下面两个错误。
搞了很久都没搞定,shrding-proxy的相关资料实在不多。
麻烦诸位大人帮忙看看,非常感谢。
报错一:
java.lang.IllegalArgumentException: Cannot find JDBC type '2003' in PostgreSQL column type
at org.apache.shardingsphere.shardingproxy.transport.postgresql.constant.PostgreSQLColumnType.valueOfJDBCType(PostgreSQLColumnType.java:187)
at org.apache.shardingsphere.shardingproxy.transport.postgresql.packet.command.query.PostgreSQLColumnDescription.<init>(PostgreSQLColumnDescription.java:48)
at org.apache.shardingsphere.shardingproxy.frontend.postgresql.command.query.text.PostgreSQLComQueryExecutor.getPostgreSQLColumnDescriptions(PostgreSQLComQueryExecutor.java:100)
at org.apache.shardingsphere.shardingproxy.frontend.postgresql.command.query.text.PostgreSQLComQueryExecutor.createQueryPacket(PostgreSQLComQueryExecutor.java:88)
at org.apache.shardingsphere.shardingproxy.frontend.postgresql.command.query.text.PostgreSQLComQueryExecutor.execute(PostgreSQLComQueryExecutor.java:75)
at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:92)
at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
报错二:
CONSOLE_LOG_PATTERN_IS_UNDEFINEDorg.postgresql.util.PSQLException: The server's client_encoding parameter was changed to UNICODE. The JDBC driver requires client_encoding to be UTF8 for correct operation.
at org.postgresql.core.v3.QueryExecutorImpl.receiveParameterStatus(QueryExecutorImpl.java:2604)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2219)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:1168)
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:103)
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)