Here you can find the source of getAllTables(Connection connection)
public static ResultSet getAllTables(Connection connection) throws SQLException
//package com.java2s; /******************************************************************************* * Copyright (c) 2015 SAP and others./*w w w.j a v a 2 s. c om*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * Contributors: * SAP - initial API and implementation *******************************************************************************/ import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.SQLException; public class Main { private static final String TABLE_NAME_PATTERN_ALL = "%"; public static ResultSet getAllTables(Connection connection) throws SQLException { DatabaseMetaData meta = connection.getMetaData(); ResultSet tableNames = meta.getTables(null, null, TABLE_NAME_PATTERN_ALL, null); return tableNames; } }