Java examples for java.sql:MySQL
MySQL Table Exists
//package com.java2s; import java.sql.*; public class Main { public static boolean TableExists(Connection dbConn, String tableName) { Statement statement = null; ResultSet resultSet = null; try {//from ww w. j av a 2 s . c o m statement = dbConn.createStatement(); resultSet = statement.executeQuery("SELECT * FROM " + tableName + " LIMIT 1"); } catch (SQLException ex) { return false; } return true; } }