返回首页

gbase数据、南大通用产品文档:GBase8s检索数据

更新日期:2024年09月11日

要检索 GBase 8s 不透明类型,必须使用 ResultSet.getObject()。GBase 8s JDBC Driver 根据
您提供的自定义类型将数据转换为 Java™ 对象。使用前面示例的 charattrUDT 类型,可以
获取此不透明数据,如下所示:
String s = "select int_col, charattr_col from charattr_tab order by 1";
System.out.println(s);

Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(s);
System.out.println("execute...ok");

System.out.println("Fetching data ...");
int curRow = 0;
while (rs.next())
{
curRow++;

GBase 8s JDBC Driver 程序员指南
南大通用数据技术股份有限公司
- 191 -

System.out.println("currentrow=" + curRow + " : ");

int intret = rs.getInt("int_col");
System.out.println(" int_col " + intret);

charattrUDT charattrret = (charattrUDT)rs.getObject("charattr_col");
System.out.print(" charattr_col ");
if (curRow == 2 || curRow == 6)
{
if (rs.wasNull())
System.out.println("");
else
System.out.println("***ERROR: " + charattrret);
}
else
System.out.println(charattrret+"");
} //while

System.out.println("total rows expected: " + curRow);
stmt.close();

GBA-02DR-0008
错误码
错误标识
错误信息
GBA-02DR-0008

Redistribute table
failed
错误出现原因
重分布过程中,表数据迁移出错
分析与建议
查看gnode 日志,检查SELECT INTO server 出错原因

功能说明
KILL thread_id 语句可以终止一个线程。Gcluster 8a MPP Cluster 应用时每个连接
都有属于自己的单独线程。
语法格式
KILL [CONNECTION | QUERY] thread_id
表5- 111 参数说明
参数名称


KILL CONNECTION
KILL CONNECTION 和没有选项修饰的KILL 相同,用于终
止指定的thread_id 线程。
KILL QUERY
中止连接当前执行的语句,但是不终止该连接本身。
thread_id
线程ID,
可用SHOW [full] PROCESSLIST 语句可以查看正在
运行的线程的信息。
说明

如果有PROCESS 权限,可以查看所有线程。

如果有SUPER 权限,可以终止所有线程和语句。否则,用户只能
查看并终止自己的线程和语句。

当用户执行一个KILL 命令,对应线程被置为killed 标记。在大多
数情况下,结束线程可能花费一些时间,因为只有在特定时期才检
查该标志。

在SELECT 循环中,在读取一部分行后将检查kill 标志,如果kill
标志被置位,该语句终止。

在ALTER TABLE期间,
在从源表中读取表的每一个部分前检查kill
标志,如果被置位,该语句中止并且删除临时表。