35 Star 99 Fork 102

openGauss / openGauss-connector-jdbc

 / 详情

通过jdbc调用gsql元命令会报错,无法解析

Done
咨询
Opened this issue  
2022-08-03 21:18

Is this a BUG REPORT or FEATURE REQUEST?:
bug。

What happened:

java代码:
Statement stmt=connection.createStatement();
stmt.executeQuery("\o \a \t /home/omm/test2.html;");

报错信息:
报错信息

jdbc版本:
jdbc版本

What you expected to happen:
希望能正常执行gsql的元命令,如:\o、\t之类的

Comments (7)

ly created缺陷

Hey @ly, Welcome to openGauss Community.
All of the projects in openGauss Community are maintained by @opengauss-bot.
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at Here to find the details.

ly changed description
ly changed description
ly changed description
ly changed description
ly changed description

@ly 这个本身就是不支持的,gsql中的命令有自己的解析规则,当识别元命令时可以自动转换为对应的查询语句。你可以通过jdbc执行对应的查询语句即可。

@周斌 请问这种情况如何通过jdbc实现一些元命令的效果,比如格式化文件之类的。查询类的不含有特殊符号的是可以执行的,但含有特殊符号就会报错,有什么办法处理一下吗

能举几个例子吗?

gsql元命令,例如:\o \a \t /home/omm/test2.html

opengauss文档地址:https://www.opengauss.org/zh/docs/3.0.0/docs/Developerguide/WDR-Snapshot%E7%94%9F%E6%88%90%E6%80%A7%E8%83%BD%E6%8A%A5%E5%91%8A.html
详见截图:
输入图片说明

yansong_lee set assignee to 周斌
yansong_lee changed issue type from 缺陷 to 咨询

/sig connectors

opengauss-bot added
 
sig/connectors
label

Hi @ly,
if you want to get quick review about your issue, please contact the owner in first: @Pike ,
and then any of the maintainers: @Pike
and then any of the committers: @travelliu , @aaronwell , @Loong , @Kamus , @vimiix , @汪伟
if you have any question, please contact the SIG: Connectors.

travelliu changed issue state from 待办的 to 已完成

Sign in to comment

Status
Assignees
Projects
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
Duration (hours)
参与者(3)
5622128 opengauss bot 1581905080
Java
1
https://gitee.com/opengauss/openGauss-connector-jdbc.git
git@gitee.com:opengauss/openGauss-connector-jdbc.git
opengauss
openGauss-connector-jdbc
openGauss-connector-jdbc

Search