前段时间想在程序里实现连接不同数据库时查询某个表是否存在这个功能,于是找到了这么一段代码:
/**
* 指定的表是否存在
* @param tableName 要检查的表名
* @return
**/
public boolean isDestinationTableExist(String tableName) {
Connection conn=null;
boolean tableExist=false;
ResultSet resultSet=null;
try {
conn=ReportUtility.evaluateDmlDao.getConnection();
resultSet=conn.getMetaData