我試圖從數據庫中列出的表,當我使用下面的語法JDBC元數據的getTables僅列出表列表
ResultSet rs = md.getTables(null, null, "%" ,null);
這將返回我所有的表,視圖,索引,system_tables從數據庫中。
,但我只需要在公共模式的表列表,所以我給下面的語法,
ResultSet rs = md.getTables(null, "public", "%" ,"TABLE");
這說明我下面的錯誤
required: String,String,String,String[]
found: <null>,String,String,String
reason: actual argument String cannot be converted to String[] by method invocation conversion
只需要單獨列出表來自公共架構。
與語法
傳遞一個數組「TABLE」作爲最後一個參數。請參閱Brian Agnew的回答 –