返回首页

gbase数据、南大通用产品文档:GBase8aGBase JDBC 获取加载任务信息示例

更新日期:2024年09月11日

Jdbc 新增了用于获取加载任务ID 号,
加载数据跳过行数的功能。
因为jdbc
标准接口并不包含该方法定义,故用户在使用时需要将标准的Statement 转化
为com.gbase.jdbc.StatementImpl 类型方可使用。
因为加载sql 语法是在8611 版本中引入的,故该功能仅支持8611 版本以
上集群。
1) 获取数据跳过行数示例

GBase 8a 程序员手册JDBC 篇
南大通用数据技术股份有限公司

- 171 -
该功能需要gbase-connector-java-8.3.81.53-build54.1 以上版本支
持(含54.1)
String loadSql="load data infile 'ftp://test:123456@192.168.7.182/1.txt' into
table loadtest fields terminated by ','";


Connection conn =DriverManager.getConnection(URL);


StatementImpl stmt = (StatementImpl) conn.createStatement();


stmt.execute("drop table if exists loadtest");


stmt.execute("create table loadtest(a int, b varchar(100))");
stmt.executeUpdate(loadSql);


long skippedLines = stmt.getSkippedLines();

2) 获取任务ID 示例
该功能需要gbase-connector-java-8.3.81.53-build54.2 以上版本支
持(含54.2)
String loadSql="load data infile 'ftp://test:123456@192.168.7.182/1.txt' into
table loadtest fields terminated by ','";


Connection conn =DriverManager.getConnection(URL);


StatementImpl stmt = (StatementImpl) conn.createStatement();


stmt.execute("drop table if exists loadtest");


stmt.execute("create table loadtest(a int, b varchar(100))");
stmt.executeUpdate(loadSql);


long taskID = stmt.getLoadTaskID();

使用 onspaces 实用程序管理数据库的存储空间。

我们提供的ODBC 接口的rpm 文件(linux 版本)格式如下:
gbaseodbc___< archtecture>.rpm。
例如:gbaseodbc_8.4_1.0_x86_64.rpm。
我们提供的ODBC 接口的bin 文件(window 版本)格式如下:
GBaseODBC---archtecture>.rar
例如:
GBaseODBC_8.3.81.53_build53.1_windows_x86.rar

GBase 8a 程序员手册ODBC 篇
南大通用数据技术股份有限公司

- 5 -