Search in sources :

Example 1 with Dialect

use of com.jfinal.plugin.activerecord.dialect.Dialect in project my_curd by qinyou.

the class SchemaInfoUtil method main.

public static void main(String[] args) {
    // 注意 InformationSchema=true
    DruidPlugin dp = new DruidPlugin("jdbc:mysql://127.0.0.1/my_curd?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useInformationSchema=true", "root", "123456");
    dp.start();
    Dialect mysqlDialect = new MysqlDialect();
    SchemaInfoUtil util = new SchemaInfoUtil(mysqlDialect, dp.getDataSource());
    List<Table> tables = util.getAllTableInfo(true);
    DbKit.getConfig().getDialect();
    DbKit.getConfig().getDataSource();
    System.out.println(JsonKit.toJson(tables));
}
Also used : MysqlDialect(com.jfinal.plugin.activerecord.dialect.MysqlDialect) DruidPlugin(com.jfinal.plugin.druid.DruidPlugin) MysqlDialect(com.jfinal.plugin.activerecord.dialect.MysqlDialect) Dialect(com.jfinal.plugin.activerecord.dialect.Dialect)

Aggregations

Dialect (com.jfinal.plugin.activerecord.dialect.Dialect)1 MysqlDialect (com.jfinal.plugin.activerecord.dialect.MysqlDialect)1 DruidPlugin (com.jfinal.plugin.druid.DruidPlugin)1