com.centit.support.database.ddl.H2DDLOperations Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of centit-database Show documentation
Show all versions of centit-database Show documentation
数据库操作通用方法和函数,从以前的util包中分离出来,并且整合了部分sys-module中的函数
The newest version!
package com.centit.support.database.ddl;
import com.centit.support.database.utils.QueryUtils;
import java.sql.Connection;
/**
* 使用H2数据库时请打开MySql兼容模式
* jdbc:h2: <url>;MODE=<databaseType>
* MODE=MySQL:兼容模式,H2兼容多种数据库,
* 该值可以为:DB2、Derby、HSQLDB、MSSQLServer、MySQL、Oracle、PostgreSQL
*
* http://www.h2database.com/html/features.html#compatibility
*/
public class H2DDLOperations extends MySqlDDLOperations {
public H2DDLOperations() {
}
public H2DDLOperations(Connection conn) {
super(conn);
}
@Override
public String makeCreateSequenceSql(final String sequenceName) {
return "create sequence " + QueryUtils.cleanSqlStatement(sequenceName);
}
}