String driverName = this.getSession().connection().getMetaData().getDriverName();
if (driverName.contains(Const.DATABASE_SQLSERVER)) {
ps = this.getSession().connection()
.prepareStatement("select next value for " + seqName + " as nextval");
} else if (driverName.contains(Const.DATABASE_ORACLE)) {
ps = this.getSession().connection()
.prepareStatement("select " + seqName + ".nextval from dual");
} else if (driverName.contains(Const.DATABASE_MYSQL)) {
//...
}
由于
答案 0 :(得分:0)
您可以按以下方式获取信息:
SessionFactoryImpl factoryImpl = (SessionFactoryImpl)sessionFactoryObject;
Properties properties = factoryImpl.getProperties();
String dialect = properties.get("dialect").toString();