赞
踩
Gbase 函数
[GBase 8s 教程]GBase 8s 常用函数、表达式_gbase函数-CSDN博客
Gbase 8s hibernate方言包下载:
select * from sysmaster:sysdbslocale
su - gbasedbt
export DB_LOCALE=zh_CN.57372
export CLIENT_LOCALE=zh_cn.utf8
执行下面这条命令会把ta的库导出到当前目录下的ta.exp文件夹中,其中表结构和表数据是分开存储的。
dbexport ta;
dbimport ta -d datadbs1 -l buffered
启动数据库服务:
oninit -vy
关闭数据库服务:
onmode -ky
查看数据库版本和运行模式:
onstat -
Springboot工程 适配南大通用(gbase 8s)
引入驱动包和方言包
hibernate-5.3.20_dbt-2.0_v1.0.jar gbasedbtjdbc.jar
- driver-class-name: com.gbasedbt.jdbc.IfxDriver
- url: jdbc:gbasedbt-sqli://10.7.215.249:9088/sysmaster:GBASEDBTSERVER=gbaseserver;db_locale=zh_cn.utf8;client_locale=zh_cn.utf8;NEWCODESET=utf8,utf8,57372
- username: gbasedbt
- password: gbasedbt123
- dialect: org.hibernate.dialect.GBasedbtDialect
问题整理:
- 使用了Mybatis-plus的分页插件时,需要手动设置方言类型为POSTGRE_SQL
- PaginationInterceptor pageHelper=new PaginationInterceptor();
- pageHelper.setDialectType(DbType.POSTGRE_SQL.getDb());
- CREATE TABLE ctl_perf_auth_info (
- id SERIAL NOT NULL,
- create_time DATETIME YEAR TO FRACTION(5),
- remark TEXT,
- PRIMARY KEY (id) CONSTRAINT u564_1587
- )
- in datadbs1 ;
把表的主键自增类型设置为SERIAL
示例:
- select
- dvc_address as dvcAddress,
- dvc_name as dvcName,
- case when
- alarm_level = 1
- then SEND_TIMES
- else 0 end
- as low,
- case when
- alarm_level = 2
- then SEND_TIMES
- else 0 end
- as middle,
- case when
- alarm_level = 3
- then SEND_TIMES
- else 0 end
- as high
- from sim_d_alarm
- CREATE SEQUENCE sim_sequence
- INCREMENT BY 1 START WITH 1
- MAXVALUE 99999999 MINVALUE 0
- NOCYCLE CACHE 10 ORDER;
例如:data_flag 的字段类型为布尔,这查询语法如下
select * from lateral_threat_main _main where _main.data_flag = 'T'
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss')from dual
select * from t_user where 1 = 1 limit ${pageNum},${pageSize}
关键字:
user、enable、label、type...
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。