返回首页

gbase数据、南大通用产品文档:GBase8cjavaxsqlPooledConnection

更新日期:2024年09月11日

javax.sql.PooledConnection 是由连接池创建的连接接口。
表8-11 对javax.sql.PooledConnection 的支持情况
方法名
返回值类型
支持JDBC 4
addConnectionEventListener
(ConnectionEventListener listener)
void
Yes
close()
void
Yes
getConnection()
Connection
Yes
removeConnectionEventListener
(ConnectionEventListener listener)
void
Yes

GBase 8c V5 开发者手册
南大通用数据技术股份有限公司
247

函数使用限制:
1.
不支持函数中DML,DDL,创建临时表;
2.
不支持函数里面涉及SQL 查询语句;
3.
不支持函数中使用下列方式给变量赋值,但没禁止;
DECLARE res int DEFAULT 0;
SET res=(SELECT COUNT(*) FROM t);
或:SELECT COUNT(*) INTO @res FROM t;
4.
不支持预处理。
SQL 场景使用限制:
SQL 中有子查询并且子查询没有from 子句,没有查询任何表,仅有投影部分。
如:
select * from t1 where b > (select now()) ; -- 子查询(select now())没有from 子句,
没有查询任何表
1.
存储过程中的定义中包含了此场景的SQL,执行存储过程时,预期报错,不
被支持;
2.
不支持对此场景的SQL 预处理执行;
3.
不支持在event 中执行此场景的SQL, event 调度执行时预期报错,
不被支持。
示例:
存储过程示例:
DELIMITER //
CREATE PROCEDURE testpro ()
BEGIN
select * from t1 where b > (select now()) ; -- 子查询(select now()) 没有查询任
何表
END //
DELIMITER ;
call testpro(); -- 预期报错
ERROR 1149 (42000): (GBA-02SC-1001) The query includes syntax that is not
supported by the gcluster.
{STATEMENT: call testpro()
INSTRUCTION: select * from t where d > (select now()) [1]}
prepare 示例:

GBase 8a MPP Cluster 产品手册
5 数据库管理指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
1382
gbase> delimiter //
gbase> create procedure p1()
begin
set @sql_str='select * from t where d > (select now())';
prepare stmt from @sql_str;
execute stmt;
end //
Query OK, 0 rows affected (Elapsed: 00:00:00.05)
gbase> delimiter ;
gbase> call p1();
ERROR 1149 (42000): (GBA-02SC-1001) The query includes syntax that is
not supported by the gcluster.
{STATEMENT: call p1()
INSTRUCTION: execute stmt [3]}
event 示例:
create event myEvent2
on schedule
every 10 second
starts current_timestamp + interval 20 second
ends current_timestamp + interval 1 minute
on completion not preserve
do insert into t2 select * from t1 where b > (select now()); -- 子查询(select
now()) 没有查询任何表, event 调度执行时预期报错:(GBA-02SC-1001) The
query includes syntax that is not supported by the gcluster

gcluster_support_binary
gcluster_support_binary 参数默认取值为1,表示允许评估出的目标表字段类型
为binary/varbinary 类型,并允许创建binary/varbinary 类型的列。当取值为0

GBase 8a MPP Cluster 最佳实践
4 参数调优
文档版本(2022-02-11)
南大通用数据技术股份有限公司
33
时则不允许创建binary/varbinary 类型的列,需要使用varchar 类型。
可根据业务需求调整该参数取值。