flowable自动创建表时找不到表

因为mysql数据库使用Schema作为数据库名称而不是目录

because mysql use Schema for database name not catalog

flowable查询表的源码:

tables = databaseMetaData.getTables(catalog, schema, tableName, JDBC_METADATA_TABLE_TYPES);

可以在url中增加&nullCatalogMeansCurrent=true参数,具体源码如下:

public java.sql.ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, final String[] types) throws SQLException {

    final SortedMap<TableMetaDataKey, Row> sortedRows = new TreeMap<>();
    final ArrayList<Row> tuples = new ArrayList<>();

    final Statement stmt = this.conn.getMetadataSafeStatement();

    if (catalog == null && this.nullCatalogMeansCurrent) {
        catalog = this.database;
    }

https://github.com/Activiti/Activiti/issues/2524

http://mybatis.org/generator/usage/mysql.html

发布了233 篇原创文章 · 获赞 7 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/china_squirrel/article/details/104970930