Add "Describe" command, with support for describing both (a) specific table(s) and...
[squelch.git] / src / main / java / net / jaekl / squelch / stmt / Stmt.java
1 package net.jaekl.squelch.stmt;
2
3 import java.io.IOException;
4 import java.io.PrintWriter;
5 import java.sql.Connection;
6 import java.sql.SQLException;
7
8 import net.jaekl.squelch.db.DbDriver;
9
10 /**
11  * Abstract base class for all statements (e.g., Insert, Create, Delete, Describe)
12  */
13
14 public abstract class Stmt {
15         // Returns true iff. line represents an instance of this statement type
16         abstract public boolean handles(String line);
17         
18         // Execute line as a statement of this type
19         abstract public int exec(DbDriver driver, Connection conn, PrintWriter pw, String line) throws IOException, SQLException;
20 }