Here you can find the source of tableExists(Connection con, String table)
private static boolean tableExists(Connection con, String table) throws IOException, SQLException
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; public class Main { private static boolean tableExists(Connection con, String table) throws IOException, SQLException { try {// w w w.ja v a2 s . co m con.createStatement().execute("select * from " + table); return true; } catch (SQLException e) { return false; } } }