本文整理匯總了Java中com.jfinal.plugin.activerecord.dialect.AnsiSqlDialect類的典型用法代碼示例。如果您正苦於以下問題:Java AnsiSqlDialect類的具體用法?Java AnsiSqlDialect怎麽用?Java AnsiSqlDialect使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AnsiSqlDialect類屬於com.jfinal.plugin.activerecord.dialect包,在下文中一共展示了AnsiSqlDialect類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: tableBindPlugin
import com.jfinal.plugin.activerecord.dialect.AnsiSqlDialect; //導入依賴的package包/類
public static TableBindPlugin tableBindPlugin(
String configName,
DruidPlugin druidPlugin,
Properties dbProp
) {
String dbUrl = dbProp.getProperty(GojaPropConst.DBURL);
if (!Strings.isNullOrEmpty(dbUrl)) {
String dbtype = JdbcUtils.getDbType(dbUrl, StringUtils.EMPTY);
// setting db table name like 'dev_info'
final TableBindPlugin atbp = new TableBindPlugin(configName, druidPlugin);
if (!StringUtils.equals(dbtype, JdbcConstants.MYSQL)) {
if (StringUtils.equals(dbtype, JdbcConstants.ORACLE)) {
atbp.setDialect(new OracleDialect());
atbp.setContainerFactory(new CaseInsensitiveContainerFactory(true));
} else if (StringUtils.equals(dbtype, JdbcConstants.POSTGRESQL)) {
atbp.setDialect(new PostgreSqlDialect());
atbp.setContainerFactory(new CaseInsensitiveContainerFactory(true));
} else if (StringUtils.equals(dbtype, JdbcConstants.H2)) {
atbp.setDialect(new AnsiSqlDialect());
atbp.setContainerFactory(new CaseInsensitiveContainerFactory(true));
} else if (StringUtils.equals(dbtype, "sqlite")) {
atbp.setDialect(new Sqlite3Dialect());
} else if (StringUtils.equals(dbtype, JdbcConstants.JTDS)) {
atbp.setDialect(new SqlServerDialect());
} else {
System.err.println("database type is use mysql.");
}
}
atbp.setShowSql(GojaConfig.getApplicationMode().isDev());
return atbp;
}
return null;
}