<groupId>net.jaekl.squelch</groupId>
<artifactId>squelch</artifactId>
<packaging>jar</packaging>
- <version>0.1</version>
+ <version>0.1a-SNAPSHOT</version>
<name>squelch</name>
<url>http://maven.apache.org</url>
<build>
String jdbcUrl = m_args.getUrl();
DbDriver driver = getDriverFor(jdbcUrl);
- try (Connection conn = getConnection(driver, jdbcUrl))
- {
- while (true) {
- boolean processed = false;
- line = ci.readLine(PROMPT);
-
- for (Stmt statement : m_statements) {
- if (statement.handles(line)) {
- try {
- statement.exec(driver, conn, pw, line);
- }
- catch (SQLException exc) {
- exc.printStackTrace(pw);
- }
- processed = true;
- break;
+ while (true) {
+ boolean processed = false;
+ line = ci.readLine(PROMPT);
+
+ for (Stmt statement : m_statements) {
+ if (statement.handles(line)) {
+ try (Connection conn = getConnection(driver, jdbcUrl)){
+ statement.exec(driver, conn, pw, line);
}
- }
-
- if ((!processed)) {
- if (isQuit(line)) {
- break;
+ catch (SQLException exc) {
+ exc.printStackTrace(pw);
}
- // Unrecognized command
- // TODO: add a string table, and a natural-language error message.
- pw.println("??? \"" + line + "\"");
+ processed = true;
+ break;
+ }
+ }
+
+ if ((!processed)) {
+ if (isQuit(line)) {
+ break;
}
- pw.flush();
+ // Unrecognized command
+ // TODO: add a string table, and a natural-language error message.
+ pw.println("??? \"" + line + "\"");
}
+ pw.flush();
}
}
}