返回首页

gbase数据、南大通用产品文档:GBase8s受支持功能部件的比较

更新日期:2024年09月11日

GBase 8s .NET Provider 和 GBASE Data Server .NET Provider 支持的功能
部件之间有几个主要区别。GBASE Data Server .NET Provider 支持的许多功
能部件不受 GBase 8s .NET Provider 支持。
下表显示了这些区别:
表 1. 比较 GBase
8s
.NET
Provider 和 GBASE
Data
Server
.NET
Provider 支
持的功能部件
功能部件
GBase 8s .NET Provider
GBASE Data Server .NET Provider
协议支持
SQLI

GBase 8s 服务器支持
GBase 8s
GBase 8s
LOB(BLOB 与 CLOB)列
大小限制
4 TB
2 GB
支持 .NET Framework

当 GBase 8s JDBC 客户机与 GBase 8s 数据库服务器交换数据时,
SECURITY 环境变量指定
执行的安全操作。在 GBase 8s JDBC Driver 中支持的SECURITY 环境变量的唯一设置
是 PASSWORD。
如果指定 PASSWORD,
则当将口令从客户机传至数据库服务器时,
使用 56 位加密来加密
用户提供的口令。没有缺省的设置。
这里是一个示例:
String URL = "jdbc:gbasedbt-sqli://158.58.10.171:1664:user=myname;
password=mypassord;GBASEDBTSERVER=myserver;SECURITY=PASSWORD";
PASSWORD 不区分大小写。
配置数据库服务器
在 GBase 8s 数据库服务器中,支持 SECURITY=PASSWORD 设置。
如果在 GBase 8s JDBC 客户机中指定 SECURITY=PASSWORD,
则在 GBase 8s 数据库服
务器上必须启用 SPWDCSM csm 选项。否则,在连接期间会返回错误。
要使用支持在数据库服务器上口令加密的 SPWDCSM csm 服务器选项,必须配置服务器
sqlhosts 服务器名称选项。在服务器上设置此选项之后,仅使用 SECURITY=PASSWORD
设置的客户机可连接至该服务器名称。
要查看如何配置 CSM 选项的通用详细信息,请参阅《GBase 8s 管理员指南》。

ifx_int8cvdbl() 函数将 C double 类型数值转换为 int8 类型数值。
语法
mint ifx_int8cvdbl(dbl_val, int8_val)
double dbl_val;
ifx_int8_t *int8_val;
dbl_val
ifx_int8cvdbl() 将其转换为 int8 类型值的 double 值。
int8_val
指向 ifx_int8cvdbl() 放置转换结果处的 int8 结构的指针。

返回代码
0
转换成功。
<0
转换失败。

示例
demo 目录中的文件 int8cvdbl.ec 包含下列样例程序。
/*
* int8cvdbl.ec *


GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 726 -

The following program converts two double type numbers to
INT8 types and displays the results.
*/

#include

EXEC SQL include "int8.h";

char result[41];

main()
{
mint x;
ifx_int8_t num;
double d = 2147483647;

printf("IFX_INT8CVDBL Sample ESQL Program running.\n\n");

printf("Number 1 (double) = 1234.5678901234\n");
if (x = ifx_int8cvdbl((double)1234.5678901234, #))
{
printf("Error %d in converting double1 to INT8\n", x);
exit(1);
}
if (x = ifx_int8toasc(#, result, sizeof(result)))
{
printf("Error %d in converting INT8 to string\n", x);
exit(1);
}
result[40] = '\0';
printf(" String Value = %s\n", result);
/* notice that the ifx_int8cvdbl function truncates digits to the right of a decimal separator.
*/

GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 727 -


printf("Number 2 (double) = %.1f\n", d);
if (x = ifx_int8cvdbl(d, #))
{
printf("Error %d in converting double2 to INT8\n", x);
exit(1);
}
if (x = ifx_int8toasc(#, result, sizeof(result)))
{
printf("Error %d in converting second INT8 to string\n", x);
exit(1);
}
result[40] = '\0';
printf(" String Value = %s\n", result);

printf("\nIFX_INT8CVDBL Sample Program over.\n\n");
exit(0);
}
输出

IFX_INT8CVDBL Sample ESQL Program running.

Number 1 (double) = 1234.5678901234
String Value = 1234
Number 2 (double) = 2147483647.0
String Value = 2147483647
IFX_INT8CVDBL Sample Program over.\