Some changes

This commit is contained in:
Thorsten Muerell
2017-10-30 12:35:54 +01:00
parent bcaa1ff609
commit 16f9b6b866
2 changed files with 4 additions and 1 deletions

View File

@@ -145,7 +145,7 @@ public class Main {
commandBuffer.append(line);
} else {
String query = commandBuffer.toString().trim();
if (query.matches("/^select.*/i")) {
if (query.toLowerCase().startsWith("select")) {
System.out.println(mapper.writeValueAsString(SqlExecutor.executeQuery(conn, query)));
} else {
System.out.println(mapper.writeValueAsString(SqlExecutor.execute(conn, query)));