SQL 数据库执行正常 但是 nutz执行异常
SELECT COLUMN_NAME as column_name FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 'wx_user';
public Sql getPrimaryKey(String tableName) {
String sqlstr = "SELECT COLUMN_NAME as column_name FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = @tableName";
Sql sql = Sqls.create(sqlstr);
sql.params().set("tableName", tableName);
sql.setCallback(Sqls.callback.entities());
return sql;
}
返回
com.alibaba.druid.pool.DruidPooledResultSet@706f8e55
日志
[DEBUG] 22:12:00.902 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT COLUMN_NAME as column_name FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = ?
| 1 |
|---------|
| wx_menu |
For example:> "SELECT COLUMN_NAME as column_name FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 'wx_menu'"