Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;

public class Main {
    public static void main(String[] argv) throws Exception {
        Connection c = null;
        DatabaseMetaData dbm = c.getMetaData();
        ResultSet rs = dbm.getTables(null, null, "employee", null);
        if (rs.next()) {
            System.out.println("Table exists");
        } else {
            System.out.println("Table does not exist");
        }
    }
}